CVE catalog

CVE-2020-4054

ruby-sanitize: CVE-2020-4054

[CVE catalog]

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.

DistributionPackageReleaseVersionStatus
Debianruby-sanitizesid7.0.0-1fixed
Debianruby-sanitizeforky7.0.0-1fixed
Debianruby-sanitizetrixie7.0.0-1fixed
Debianruby-sanitizebookworm6.0.0-1.1+deb12u1fixed
Debianruby-sanitizebookworm-security6.0.0-1.1+deb12u1fixed
Ubunturuby-sanitize20.044.6.6-2vulnerable
Ubunturuby-sanitize20.044.6.6-2.1~0.20.04.1fixed
Ubunturuby-sanitize16.042.1.0-1vulnerable
Ubunturuby-sanitize16.042.1.0-2vulnerable
Ubunturuby-sanitize16.042.1.0-2+deb9u1build0.16.04.1vulnerable
Ubunturuby-sanitize18.042.1.0-2vulnerable
Ubunturuby-sanitize18.042.1.0-2+deb9u1build0.18.04.1vulnerable
Ubunturuby-sanitize20.044.6.6-2vulnerable
Ubunturuby-sanitize20.044.6.6-2.1~0.20.04.1fixed

Fixed-version evidence

DistributionPackageTypeReleaseFixed versionUrgencyOriginBugs
Debianruby-sanitizesourcesid4.6.6-2.1not yet assignedNot reported[963808]
Debianruby-sanitizesourceforky4.6.6-2.1not yet assignedNot reported[963808]
Debianruby-sanitizesourcetrixie4.6.6-2.1not yet assignedNot reported[963808]
Debianruby-sanitizesourcebookworm4.6.6-2.1not yet assignedNot reported[963808]
Ubunturuby-sanitizedeb20.044.6.6-2.1~0.20.04.1Not reportedUSN-4543-1Not reported
Ubunturuby-sanitizedeb20.044.6.6-2.1~0.20.04.1Not reportedUBUNTU-CVE-2020-4054Not reported

[Debian bug #963808]

OpenFactory catalog packages

[Debian 12 (Bookworm)]

  • Details (4)
    • 6.0.0-1.1+deb12u1 · all · bookworm

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12

    • 6.0.0-1.1+deb12u1 · all · bookworm

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12

    • 6.0.0-1.1+deb12u1 · all · bookworm-security

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12

    • 6.0.0-1.1+deb12u1 · all · bookworm-security

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · bookworm; dsa · ruby-sanitize · debian · 12

[Debian 13 (Trixie)]

  • Details (2)
    • 7.0.0-1 · all · trixie

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · 13

    • 7.0.0-1 · all · trixie

      Fixed · Fixed: 4.6.6-2.1

      dsa · ruby-sanitize · debian · 13

Observed:

References