CVE-2022-23518 Improper neutralization of data URIs allows XSS in rails-html-sanitizer
Attackers can execute arbitrary scripts via data URIs in Rails applications using vulnerable versions of the rails-html-sanitizer library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-23518?
CVE-2022-23518 is a medium-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, and only if a user opens a file or follows a link.
Official description
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Versions >= 1.0.3, < 1.4.4 are vulnerable to cross-site scripting via data URIs when used in combination with Loofah >= 2.1.0. This issue is patched in version 1.4.4.
Weakness: CWE-79
Which versions are affected by CVE-2022-23518?
2 open source packages ship an affected version, including rails-html-sanitizer. It affects 3 products.
| Package | Affected | Fixed in |
|---|---|---|
rails-html-sanitizer RubyGems | From 1.0.3 | 1.4.4 |
rails-html-sanitizer RubyGems | From 1.0.3 | 1.4.4 |
Products include Debian Debian Linux, Loofah Project Loofah, Rubyonrails Rails Html Sanitizers.
How do I fix CVE-2022-23518?
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-23518 being exploited?
There is no known exploitation of CVE-2022-23518 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as DEBIAN-CVE-2022-23518, GHSA-mcvf-2q2m-x72m, UBUNTU-CVE-2022-23518.