6.1medium
Improper neutralization of data URIs allows XSS in rails-html-sanitizer
- Severity
- 6.1medium CVSS:3.0 by GitHub_M
- Exploit likelihood
- 0.94% (higher than 62% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-mcvf-2q2m-x72m
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
| Product or package | Versions | Reported by |
|---|---|---|
| rails rails-html-sanitizer | >= 1.0.3, < 1.4.4 | CVE List |
| rails-html-sanitizer (RubyGems) | from 1.0.3 before 1.4.4 | GitHub Advisory Database |
| rubyonrails rails_html_sanitizers | from 1.0.3 before 1.4.4 | NVD |
| debian debian_linux | 10.0 | NVD |
| loofah_project loofah | from 2.1.0 before 2.19.1 | NVD |
All scores
| GitHub_M | 6.1medium CVSS:3.0 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
Summary
rails-html-sanitizer >= 1.0.3, < 1.4.4 is vulnerable to cross-site scripting via data URIs when used in combination with Loofah >= 2.1.0.
Mitigation
Upgrade to rails-html-sanitizer >= 1.4.4.
Severity
The maintainers have evaluated this as Medium Severity 6.1.
References
- CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)
- SVG MIME Type (image/svg+xml) is misleading to developers · Issue #266 · w3c/svgwg
- https://github.com/rails/rails-html-sanitizer/issues/135
- https://hackerone.com/reports/1694173
Credit
This vulnerability was independently reported by Maciej Piechota (@haqpl) and Mrinmoy Das (@goromlagche).
NVD (es)
rails-html-sanitizer es responsable de sanitizar fragmentos HTML en aplicaciones Rails. Las versiones >= 1.0.3, < 1.4.4 son vulnerables a Cross-Site Scripting (XSS) a través de URI de datos cuando se usan en combinación con Loofah >= 2.1.0. Este problema está parcheado en la versión 1.4.4.
References
| https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m | third-party-advisory, web | |
| https://github.com/rails/rails-html-sanitizer/issues/135 | exploit, issue-tracking, third-party-advisory, web | |
| https://hackerone.com/reports/1694173 | permissions-required, third-party-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html | mailing-list, third-party-advisory, web | |
| https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-23518 | advisory | |
| https://github.com/w3c/svgwg/issues/266 | web | |
| https://github.com/rails/rails-html-sanitizer | package | |
| https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23518.yml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-23518 changed 2025-11-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-mcvf-2q2m-x72m changed 2025-11-04 | CC-BY-4.0 |
| NVD | CVE-2022-23518 changed 2026-06-17 | Public domain |