6.1medium
Cross-site scripting in net/http/cgi and net/http/fcgi
- Severity
- 6.1medium CVSS:3.1 by NVD
- Exploit likelihood
- 3.65% (higher than 89% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GO-2021-0226BIT-GOLANG-2020-24553
Description
Go before 1.14.8 and 1.15.x before 1.15.1 allows XSS because text/html is the default for CGI/FCGI handlers that lack a Content-Type header.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| stdlib (Go) | before 1.14.8, from 1.15.0-0 before 1.15.1 | Go Vulnerability Database |
| golang go | before 1.14.8, from 1.15.0 before 1.15.1 | NVD |
| fedoraproject fedora | 33 | NVD |
| opensuse leap | 15.1, 15.2 | NVD |
| oracle communications_cloud_native_core_policy | 1.5.0 | NVD |
| golang (Bitnami) | before 1.14.8, from 1.15.0 before 1.15.1 | Bitnami Vulnerability Database |
All scores
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
What each source says
CVE List
Go before 1.14.8 and 1.15.x before 1.15.1 allows XSS because text/html is the default for CGI/FCGI handlers that lack a Content-Type header.
Go Vulnerability Database
When a Handler does not explicitly set the Content-Type header, the the package would default to “text/html”, which could cause a Cross-Site Scripting vulnerability if an attacker can control any part of the contents of a response.
The Content-Type header is now set based on the contents of the first Write using http.DetectContentType, which is consistent with the behavior of the net/http package.
Although this protects some applications that validate the contents of uploaded files, not setting the Content-Type header explicitly on any attacker-controlled file is unsafe and should be avoided.
NVD (es)
Go versiones anteriores a 1.14.8 y versiones 1.15.x anteriores a 1.15.1, permite un ataque de tipo XSS porque text/html es el predeterminado para los manejadores de CGI/FCGI que carecen de un encabezado Content-Type
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2020-24553 changed 2024-08-04 | CVE Terms of Use |
| Go Vulnerability Database | GO-2021-0226 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2020-24553 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2020-24553 changed 2026-09-08 | Apache-2.0 |