CVE-2022-23518: Improper neutralization of data URIs may allow XSS in rails-html-sanitizer
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.44197%
CWE
Published
12/13/2022
Updated
9/14/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| rails-html-sanitizer | rubygems | >= 1.0.3, < 1.4.4 | 1.4.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from missing data URI validation in rails-html-sanitizer's attribute scrubbing logic. The GitHub issue #135 specifically shows the PermitScrubber's scrub_attribute() method (lines 142-154 in scrubbers.rb) lacks the safe data URI checks present in Loofah's implementation. This allows XSS via crafted data:text/html and data:application/vnd.wap.xhtml+xml URIs. The test case demonstrates the sanitizer fails to remove dangerous data URIs in iframe src attributes when allowed tags/attributes are permitted.