Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
CVE-2024-53985Published 2 Dec 2024, 21:15 UTC
Real-world risk
0.9/ 10Low
Routine
If the vulnerable configuration applies to you: 2.0
PreliminaryFrom the CVSS vector only · confidence low
CVSS
2.3
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
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 and Nokogiri < 1.15.7, or 1.16.x < 1.16.8. The 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 with both "math" and "style" elements or both both "svg" and "style" elements. This vulnerability is fixed in 1.6.1.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| rails-html-sanitizerNiche | >= 1.6.0, < 1.6.1 | 1.6.1 |
What to do
Update to a fixed version: 1.6.1.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | RoutineA normal action: open a file, visit a page, click a link | From the CVSS vector | 0.70 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T3: Public proof of concept (× 0.95)
A qualifying GitHub proof of concept, an unverified Exploit-DB entry, CISA's SSVC says PoC, or a reference tagged as an exploit
- CISA SSVC: proof of concept
EPSS 0.6% chance of exploitation in 30 days (percentile 52), as of 2026-12-04.
The arithmetic
- Prerequisites multiplied together0.315
- Threat T3: Public proof of concept0.950
- 10 × impact 0.3 × prerequisites 0.315 × threat 0.950.898
- Rounded to one decimal between 0.1 and 100.9
Exploitation and evidence timeline
- 2 Dec 2024 Published
- 3 Dec 2026 CISA SSVC: proof of concept first seen
- 3 Dec 2026 Risk 0.9 (cvss fallback)
Weakness
CWE-79
References
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-w8gc-x259-rc7xvendor-advisory
- https://github.com/rails/rails-html-sanitizer/commit/b0220b8850d52199a15f83c472d175a4122dd7b1misc
- https://github.com/rails/rails-html-sanitizer/commit/cd18b0ef00aad1d4a9e1c5d860cd23f80f63c505misc
- CVE-2024-53985 on CVE.org