# CVE-2024-53986: Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0

- Priority: **Routine**
- Reason: Not severe (CVSS 2.3, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-12-02 · Modified: 2024-12-03
- Aliases: UBUNTU-CVE-2024-53986, GHSA-638j-pmjw-jq48
- Record: https://cvemate.com/vulnerability/CVE-2024-53986 · JSON: https://cvemate.com/vulnerability/CVE-2024-53986/json

## Description

```text
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. There is a possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer 1.6.0 when used with Rails >= 7.1.0. A possible XSS vulnerability with certain configurations of Rails::HTML::Sanitizer may allow an attacker to inject content if HTML5 sanitization is enabled and the application developer has overridden the sanitizer's allowed tags where the "math" and "style" elements are both explicitly allowed. This vulnerability is fixed in 1.6.1.
```

## Signals

- CVSS: 6.1 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- EPSS: 0.503%, percentile 44.661%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- ubuntu ruby-rails-html-sanitizer (Ubuntu): All versions (No fix recorded)
- RubyGems rails-html-sanitizer (RubyGems): ≥ 1.6.0, \< 1.6.1
- rails rails-html-sanitizer: ≥ 1.6.0, \< 1.6.1
- rubyonrails rails\_html\_sanitizers: 1.6.0

## References

- <https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-638j-pmjw-jq48>
- <https://github.com/rails/rails-html-sanitizer/commit/f02ffbb8465e73920b6de0da940f5530f855965e>
- <https://ubuntu.com/security/CVE-2024-53986>
- <https://www.cve.org/CVERecord?id=CVE-2024-53986>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-53986>
- <https://github.com/rails/rails-html-sanitizer>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml>

---

Data as of 2026-12-05T13:22:54.617Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
