Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- None · None · None
- Fix status
- Partial Red Hat: 2 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-79.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Rails | rails-html-sanitizer | 1.6.0 to before 1.6.1 | 1.6.1 | Patch available | CNA |
| — | rails-html-sanitizer (RubyGems) | 1.6.0 to before 1.6.1 | 1.6.1 | Patch available | GHSA-w8gc-x259-rc7x |
- rails-html-sanitizer VendorRails Affected 1.6.0 to before 1.6.1 Fixed in 1.6.1 Patch available CNA
- rails-html-sanitizer (RubyGems) Vendor— Affected 1.6.0 to before 1.6.1 Fixed in 1.6.1 Patch available GHSA-w8gc-x259-rc7x
Remediation
- Fix · CNA rails-html-sanitizer (rails) Fixed in 1.6.1
- Fix · GHSA-w8gc-x259-rc7x rails-html-sanitizer (RubyGems) Fixed in 1.6.1 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Low. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat 3scale API Management Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
Not affected: 2 products
- Red Hat 3scale API Management Platform 2
- Red Hat Satellite 6
Timeline
- 2026-10-02 Threatist record created from CVE-2024-53985
- 2026-10-03 Alias added: GHSA-w8gc-x259-rc7x
References
Patch 2
Advisory 2
More Rails Html Sanitizers vulnerabilities
- TI-2022-13919 Cross-site scripting in https://github.com/rails/rails-html-sanitizer CVSS 3.1MEDIUM 6.1
- TI-2022-07576 Inefficient Regular Expression Complexity in rails-html-sanitizer CVSS 3.1HIGH 7.5
- TI-2022-07578 Possible XSS vulnerability with certain configurations of rails-html-sanitizer CVSS 3.1HIGH 7.2
- TI-2022-07579 rails-html-sanitizer contains an incomplete fix for an XSS vulnerability CVSS 3.1MEDIUM 6.1
- TI-2022-07577 Improper neutralization of data URIs allows XSS in rails-html-sanitizer CVSS 3.1MEDIUM 6.1
- TI-2024-36148 Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0 CVSS 4.0LOW 2.3
Sources
- CVE-2024-53985 · CVE Program
- CVE-2024-53985 · NVD
- FIRST EPSS
- GHSA-w8gc-x259-rc7x · GitHub Advisory Database · CC BY 4.0
- CVE-2024-53985 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences