CVE-2020-4054

Cross-site Scripting in Sanitize

HIGH
7.3
CVSS Score
Published: June 16, 2020 at 10:10 PM UTC
Updated: June 17, 2026 at 03:19 AM UTC
2 products affected across 2 vendorsSanitizeSanitize

Using Sanitize by rgrove?

Get instant alerts when new vulnerabilities affect Sanitize - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
HIGH7.3
Exploit prediction
EPSS 2%

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

3.0.0 ≤ v < 5.2.1
Affected range stops below 5.2.1, so it looks safe — our inference, not a vendor statement
v < 5.2.1
Affected range stops below 5.2.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

CVSS

7.3HIGHGitHub_M
Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
LOW
Integrity
LOW
Availability
LOW
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card