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

- Severity: High 7.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/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): 1.08%, higher than 65% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2022-12-13T17:50:25.000Z
- Modified: 2026-06-17T04:30:17.187Z
- Also known as: GHSA-9h9g-93gc-623h
- Weaknesses: CWE-79
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- rails rails-html-sanitizer: < 1.4.4
- rails-html-sanitizer (RubyGems): before 1.4.4
- rubyonrails rails_html_sanitizers: before 1.4.4
- debian debian_linux: 10.0

## Every score

- GitHub_M: CVSS:3.1 7.2 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/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/security/advisories/GHSA-9h9g-93gc-623h> (exploit, third-party-advisory, web)
- <https://hackerone.com/reports/1656627> (exploit, 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-23519> (advisory)
- <https://github.com/rails/rails-html-sanitizer> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23519.yml> (web)

## Sources

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

---

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