CVE-2020-4054: Cross-site Scripting in Sanitize
Vulnerability summary
CVE-2020-4054 is a high (CVSS 7.3) vulnerability in rgrove sanitize. EPSS estimates a 1.92% chance of exploitation in the next 30 days, higher than 80.5% of scored vulnerabilities.
Severe, CVSS 7.3 (CVE.org); no exploitation reported by the 5 checked sources; EPSS 2% (FIRST, 04-12-2026)
Source freshness unavailable
How is this decided?Timeline
- 16-06-2020PublishedVulnerability first disclosed.
- 04-08-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
6 scores · 5 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated7.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- OSV · DebianEcosystem advisory · calculated7.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- OSV · RubygemsEcosystem advisory · calculated7.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- NVDNIST7.3HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
EPSS trend
Probability
1.92%
Chance of exploitation in the next 30 days
Percentile
81%
Versus all other CVEs
30-day change
No change 0.00 pp
From 1.92% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Debian1 product
- ruby-sanitize< 4.6.6-2.1 | < 4.6.6-2.1~deb10u1
Rgrove1 product
- sanitize≥ 3.0.0, < 5.2.1
RubyGems1 product
- sanitize≥ 3.0.0, < 5.2.1
Sanitize_project1 product
- sanitize≥ 3.0.0, < 5.2.1
Ubuntu1 product
- ruby-sanitizeAll versions (No fix recorded) | < 4.6.6-2.1~0.20.04.1
5 vendors · 5 products
References
13 links- github.com/rgrove/sanitize/security/advisories/GHSA-p4x4-rw2p-8j8mX Refsource CONFIRMREPORTWEBThird Party Advisory
- github.com/rgrove/sanitize/commit/a11498de9e283cd457b35ee252983662f7452aa9X Refsource MISCREPORTWEBPatchThird Party Advisory
- github.com/rgrove/sanitize/releases/tag/v5.2.1X Refsource MISCREPORTWEBRelease NotesThird Party Advisory
Show all 13 references
- github.com/rgrove/sanitizePACKAGE