CVE-2024-53986
rails-html-sanitizer: Possible XSS vulnerability with certain configurations of rails-html-sanitizer 1.6.0
Overview
Description
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.
Source: OX vulnerability database
Severity
6.1 · LOW
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Changed
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness: CWE-79
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| RubyGems | rails-html-sanitizer | >=1.6.0, <1.6.1 | 1.6.1 |
Open a package to see all its vulnerabilities.
Operating systems · 2 fixes
Red Hat 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 7 (satellite:el8) | rubygem-rails-html-sanitizer | affected |
openSUSE 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | ruby4-0-rubygem-rails-html-sanitizer | 1.7.0-1.1 | openSUSE-SU-2026:10569-1 |
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2024-53986
- github.com https://github.com/advisories/GHSA-638j-pmjw-jq48
- github.com https://github.com/rails/rails-html-sanitizer
- github.com https://github.com/rails/rails-html-sanitizer/blob/v1.6.1/CHANGELOG.md
- github.com https://github.com/rails/rails-html-sanitizer/commit/f02ffbb8465e73920b6de0da940f5530f855965e
- github.com https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-638j-pmjw-jq48
- github.com https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2024-53986.yml
- hackerone.com https://hackerone.com/reports/2931636
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2024-53986
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2024-53986
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.