# CVE-2022-23518: Improper neutralization of data URIs allows XSS in rails-html-sanitizer

- Severity: Medium 6.1 (CVSS:3.0, scored by GitHub_M) `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.94%, higher than 62% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-12-13T17:45:39.000Z
- Modified: 2026-06-17T04:30:17.073Z
- Also known as: GHSA-mcvf-2q2m-x72m
- Weaknesses: CWE-79
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- rails rails-html-sanitizer: >= 1.0.3, < 1.4.4
- rails-html-sanitizer (RubyGems): from 1.0.3 before 1.4.4
- rubyonrails rails_html_sanitizers: from 1.0.3 before 1.4.4
- debian debian_linux: 10.0
- loofah_project loofah: from 2.1.0 before 2.19.1

## Every score

- GitHub_M: CVSS:3.0 6.1 Medium `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/rails/rails-html-sanitizer/issues/135> (exploit, issue-tracking, third-party-advisory, web)
- <https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m> (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

- CVE List: [CVE-2022-23518](https://www.cve.org/CVERecord?id=CVE-2022-23518), CVE Terms of Use, modified 2025-11-03
- GitHub Advisory Database: [GHSA-mcvf-2q2m-x72m](https://github.com/advisories/GHSA-mcvf-2q2m-x72m), CC-BY-4.0, modified 2025-11-04
- NVD: [CVE-2022-23518](https://nvd.nist.gov/vuln/detail/CVE-2022-23518), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-23518 · Whole record: https://cve.day/CVE-2022-23518.json · Rebuilt by cve.day 2026-11-25T22:58:17.528Z
