CVE-2018-17031 Gogs XSS Vulnerability
An attacker can trigger XSS in Gogs by uploading a crafted .eml file due to missing MIME type sniffing headers.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2018-17031?
CVE-2018-17031 is a medium-severity cross-site scripting vulnerability in n/a, published on 14 Sep 2018. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
In Gogs 0.11.53, an attacker can use a crafted .eml file to trigger MIME type sniffing, which leads to XSS, as demonstrated by Internet Explorer, because an "X-Content-Type-Options: nosniff" header is not sent.
Weakness: CWE-79
Which versions are affected by CVE-2018-17031?
3 open source packages ship an affected version, including gogs.io/gogs. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
gogs.io/gogs Go | All versions | 0.12.0 |
gogs.io/gogs Go | All versions | 0.12.0 |
gogs.io/gogs Go | All versions | 0.12.0 |
Products include Gogs Gogs.
How do I fix CVE-2018-17031?
Upgrade gogs.io/gogs to 0.12.0 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2018-17031 being exploited?
There is no known exploitation of CVE-2018-17031 in the wild and no public exploit code.
Other vulnerabilities in n/a
Sources
Also known as GHSA-px5r-fqj6-r2f8, GO-2023-1972.