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

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/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): 1.21%, higher than 69% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2022-12-13T17:51:40.000Z
- Modified: 2026-06-17T04:30:17.300Z
- Also known as: GHSA-rrfc-7g8p-99q8
- 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, 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.

(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 6.1 Medium `CVSS:3.1/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/security/advisories/GHSA-rrfc-7g8p-99q8> (exploit, third-party-advisory, web)
- <https://hackerone.com/reports/1654310> (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-23520> (advisory)
- <https://github.com/rails/rails-html-sanitizer> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-23520.yml> (web)

## Sources

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

---

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