What’s Vulnerable › Vulnerabilities
CVE-2022-23518: Improper neutralization of data URIs allows XSS in rails-html-sanitizer
- Severity: medium (CVSS 6.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.9% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-12-14 · updated 2026-06-17
- Weakness: CWE-79
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.
Affected products
- Debian Linux: 10.0
- flavorjones loofah: from 2.1.0 before 2.19.1 — fixed in 2.19.1
- rails-html-sanitizer: from 1.0.3 before 1.4.4 — fixed in 1.4.4
- Rubygems Rails-Html-Sanitizer: from 1.0.3 before 1.4.4; 1.0.3, 1.0.4, 1.1.0, 1.2.0, 1.3.0, 1.4.0 (+3) — fixed in 1.4.4
How to fix
Upgrade to a fixed version: flavorjones loofah 2.19.1; rails-html-sanitizer 1.4.4; Rubygems Rails-Html-Sanitizer 1.4.4. Check the vendor advisory for mitigations.
References
- https://github.com/rails/rails-html-sanitizer/issues/135
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m
- https://hackerone.com/reports/1694173
- https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html
- https://github.com/rails/rails-html-sanitizer/issues/135
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m
- https://hackerone.com/reports/1694173
- https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html
- https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html
Get alerted when CVE-2022-23518 or the next vulnerability affects your stack