
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2020-4054 is a cross-site scripting (XSS) vulnerability affecting Sanitize (RubyGem sanitize) versions 3.0.0 through 5.2.1. The vulnerability was discovered by Michał Bentkowski of Securitum and disclosed in June 2020. The issue affects the HTML sanitization functionality when using Sanitize's "relaxed" config or custom configurations that allow certain HTML elements (GitHub Advisory, Ubuntu Notice).
The vulnerability occurs when HTML is sanitized using Sanitize's "relaxed" config or a custom config that allows certain elements. Content in math or svg elements may not be sanitized correctly even if these elements are not in the allowlist. The vulnerability affects configurations that allow one or more of the following HTML elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. The issue has a CVSS base score of 7.3 (High), indicating significant severity (Ubuntu Security).
Using carefully crafted input, an attacker could potentially exploit this vulnerability to bypass HTML sanitization controls and inject arbitrary HTML content. This could result in cross-site scripting (XSS) attacks or other undesired behavior when the compromised HTML is rendered in a browser (GitHub Advisory).
The vulnerability can be exploited by providing specially crafted input that takes advantage of the improper sanitization of math or svg elements. The attack requires no special privileges or user interaction, making it relatively straightforward to exploit (Ubuntu Security).
The vulnerability has been fixed in Sanitize version 5.2.1. For users unable to upgrade, a workaround is available by overriding the default value of Sanitize's :remove_contents config option with an array containing the following elements: iframe, math, noembed, noframes, noscript, plaintext, script, style, svg, xmp. This ensures that the contents of these elements are removed entirely when they are not in the allowlist (GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."