CVEfocus › CVE database › CVE-2020-4054

CVE-2020-4054Cross-site Scripting in Sanitize

CVSS 7.3 HighEPSS 1.9% (higher than 80% of CVEs)Published 2020-06-16Updated 2024-08-04Assigner: GitHub_M

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.

CWE-79

What to do

Fixed builds are available from Debian, RubyGems, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

5Fixed
2Fix pending
4Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04ruby-sanitizeNot affected
vulnerable_code_not_present
Ubuntu 25.10ruby-sanitizeNot affected
vulnerable_code_not_present
Ubuntu 24.04ruby-sanitizeNot affected
vulnerable_code_not_present
Ubuntu 22.04ruby-sanitizeNot affected
vulnerable_code_not_present
Ubuntu 20.04ruby-sanitizeFixed4.6.6-2.1~0.20.04.1UBUNTU-CVE-2020-4054
Ubuntu 18.04ruby-sanitizeFix pendingUBUNTU-CVE-2020-4054
Ubuntu 16.04ruby-sanitizeFix pendingUBUNTU-CVE-2020-4054
Debian 14ruby-sanitizeFixed4.6.6-2.1DEBIAN-CVE-2020-4054
Debian 13ruby-sanitizeFixed4.6.6-2.1DEBIAN-CVE-2020-4054
Debian 12ruby-sanitizeFixed4.6.6-2.1DEBIAN-CVE-2020-4054
RubyGems librarysanitizeFixed5.2.1GHSA-p4x4-rw2p-8j8m

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.