
CVE catalog
CVE-2020-4054
ruby-sanitize: CVE-2020-4054
- Severity
- Medium
- Published
- Source
- [NVD] · [CVE record]
- EPSS
- 1.85% · Oct 25, 2026
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.
Vulnerable and fixed packages
Distribution-reported package versions and fixes. These do not depend on matching against the OpenFactory package catalog.
| Distribution | Package | Release | Version | Status |
|---|---|---|---|---|
| Debian | ruby-sanitize | sid | 7.0.0-1 | fixed |
| Debian | ruby-sanitize | forky | 7.0.0-1 | fixed |
| Debian | ruby-sanitize | trixie | 7.0.0-1 | fixed |
| Debian | ruby-sanitize | bookworm | 6.0.0-1.1+deb12u1 | fixed |
| Debian | ruby-sanitize | bookworm-security | 6.0.0-1.1+deb12u1 | fixed |
| Ubuntu | ruby-sanitize | 20.04 | 4.6.6-2 | vulnerable |
| Ubuntu | ruby-sanitize | 20.04 | 4.6.6-2.1~0.20.04.1 | fixed |
| Ubuntu | ruby-sanitize | 16.04 | 2.1.0-1 | vulnerable |
| Ubuntu | ruby-sanitize | 16.04 | 2.1.0-2 | vulnerable |
| Ubuntu | ruby-sanitize | 16.04 | 2.1.0-2+deb9u1build0.16.04.1 | vulnerable |
| Ubuntu | ruby-sanitize | 18.04 | 2.1.0-2 | vulnerable |
| Ubuntu | ruby-sanitize | 18.04 | 2.1.0-2+deb9u1build0.18.04.1 | vulnerable |
| Ubuntu | ruby-sanitize | 20.04 | 4.6.6-2 | vulnerable |
| Ubuntu | ruby-sanitize | 20.04 | 4.6.6-2.1~0.20.04.1 | fixed |
Fixed-version evidence
| Distribution | Package | Type | Release | Fixed version | Urgency | Origin | Bugs |
|---|---|---|---|---|---|---|---|
| Debian | ruby-sanitize | source | sid | 4.6.6-2.1 | not yet assigned | Not reported | [963808] |
| Debian | ruby-sanitize | source | forky | 4.6.6-2.1 | not yet assigned | Not reported | [963808] |
| Debian | ruby-sanitize | source | trixie | 4.6.6-2.1 | not yet assigned | Not reported | [963808] |
| Debian | ruby-sanitize | source | bookworm | 4.6.6-2.1 | not yet assigned | Not reported | [963808] |
| Ubuntu | ruby-sanitize | deb | 20.04 | 4.6.6-2.1~0.20.04.1 | Not reported | USN-4543-1 | Not reported |
| Ubuntu | ruby-sanitize | deb | 20.04 | 4.6.6-2.1~0.20.04.1 | Not reported | UBUNTU-CVE-2020-4054 | Not reported |
OpenFactory catalog packages
[Debian 12 (Bookworm)]
- [ruby-sanitize]Fixed
Details (4)
6.0.0-1.1+deb12u1· all · bookwormFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12
6.0.0-1.1+deb12u1· all · bookwormFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12
6.0.0-1.1+deb12u1· all · bookworm-securityFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12
6.0.0-1.1+deb12u1· all · bookworm-securityFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12
[Debian 13 (Trixie)]
- [ruby-sanitize]Fixed
Details (2)
7.0.0-1· all · trixieFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · 13
7.0.0-1· all · trixieFixed · Fixed:
4.6.6-2.1dsa · ruby-sanitize · debian · 13
Observed:
References
- [https://osv.dev/vulnerability/DEBIAN-CVE-2020-4054]
- [https://osv.dev/vulnerability/DSA-4730-1]
- [https://osv.dev/vulnerability/UBUNTU-CVE-2020-4054]
- [https://osv.dev/vulnerability/USN-4543-1]
- [https://security-tracker.debian.org/tracker/CVE-2020-4054]
[Debian Security Tracker] · [FIRST EPSS] · [OSV Package Vulnerability Database]