CVE-2020-4054
Cross-site Scripting in Sanitize
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
Description
In Sanitize (RubyGem sanitize) greater than or equal to 3.0.0 and less than 5.2.1, there is a cross-site scripting vulnerability. When HTML is sanitized using Sanitize's "relaxed" config, or a custom config that allows certain elements, some content in a math or svg element may not be sanitized correctly even if math and svg are not in the allowlist. You are likely to be vulnerable to this issue if you use Sanitize's relaxed config or a custom config that allows one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. Using carefully crafted input, an attacker may be able to sneak arbitrary HTML through Sanitize, potentially resulting in XSS (cross-site scripting) or other undesired behavior when that HTML is rendered in a browser. This has been fixed in 5.2.1.
Timeline
ID reserved
By GitHub_M
- 6 months later
· 6 months later
Published
- 4 years later
· 4 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High7.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
| NVDNVD · Modified | 3.1 | High7.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
- EPSS (exploitation in 30 days)
- 1.9% · top 20% of all CVEs (7 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.3.
Weakness
Affected products
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- RubyGemssanitizeGHSA-p4x4-rw2p-8j8m (opens in a new tab)
References (5)
- https://github.com/rgrove/sanitize/security/advisories/GHSA-p4x4-rw2p-8j8m (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/rgrove/sanitize/commit/a11498de9e283cd457b35ee252983662f7452aa9 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/rgrove/sanitize/releases/tag/v5.2.1 (opens in a new tab)x_refsource_MISCx_transferred
- DSA-4730 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- USN-4543-1 (opens in a new tab)vendor-advisoryx_refsource_UBUNTUx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-p4x4-rw2p-8j8m (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2020-4054)Record last updated .