CVE-2022-23519 Possible XSS vulnerability with certain configurations of rails-html-sanitizer
Attackers can inject malicious scripts via XSS if developers override allowed tags to include style with math or svg elements.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-23519?
CVE-2022-23519 is a high-severity cross-site scripting vulnerability in Debian Debian Linux, published on 14 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags in either of the following ways: allow both "math" and "style" elements, or allow both "svg" and "style" elements. Code is only impacted if allowed tags are being overridden. . This issue is fixed in version 1.4.4. All users overriding the allowed tags to include "math" or "svg" and "style" should either upgrade or use the following workaround immediately: Remove "style" from the overridden allowed tags, or remove "math" and "svg" from the overridden allowed tags.
Weakness: CWE-79
Which versions are affected by CVE-2022-23519?
2 open source packages ship an affected version, including rails-html-sanitizer. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
rails-html-sanitizer RubyGems | All versions | 1.4.4 |
rails-html-sanitizer RubyGems | All versions | 1.4.4 |
Products include Debian Debian Linux, Rubyonrails Rails Html Sanitizers.
How do I fix CVE-2022-23519?
Upgrade rails-html-sanitizer to 1.4.4 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2022-23519 being exploited?
There is no known exploitation of CVE-2022-23519 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2022-23519, GHSA-9h9g-93gc-623h, UBUNTU-CVE-2022-23519.