Regular expression denial of service in rails-html-sanitizer
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-1333.
Summary
rails-html-sanitizer from 1.0.3 before 1.7.2 uses an inefficient regular expression in Rails::HTML::PermitScrubber (CWE-1333). An attacker who supplies HTML can cause quadratic CPU consumption when the application allows an SVG reference element such as use and permits href or xlink:href. The default tag configuration is not affected, and the slow matching occurs only on CRuby 3.1 and earlier and JRuby.
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
Description from the CNA
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. From 1.0.3 through 1.7.1, Rails::HTML::PermitScrubber checks SVG href and xlink:href local references with a pattern whose line-start anchor and whitespace class cause an all-whitespace value to be rescanned from each line start. An attacker who supplies HTML can cause quadratic CPU consumption when an application customizes its allowed tags to include an SVG reference element such as use and permits href or xlink:href. The default allowed tag configuration is not affected. CRuby 3.2 and later uses linear-time regular expression matching for this pattern, while CRuby 3.1 and earlier and JRuby are affected. This issue is fixed in version 1.7.2.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- Yes
- 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.0.3 to before 1.7.2 | 1.7.2 | Patch available | CNA |
| — | rails-html-sanitizer (RubyGems) | 1.0.3 to before 1.7.2 | 1.7.2 | Patch available | GHSA-cpgf-5mjf-73p7 |
- rails-html-sanitizer VendorRails Affected 1.0.3 to before 1.7.2 Fixed in 1.7.2 Patch available CNA
- rails-html-sanitizer (RubyGems) Vendor— Affected 1.0.3 to before 1.7.2 Fixed in 1.7.2 Patch available GHSA-cpgf-5mjf-73p7
Remediation
Update rails-html-sanitizer to version 1.7.2, the fixed version listed for both the rails and RubyGems entries of the package.
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
- Fix · CNA rails-html-sanitizer (rails) Fixed in 1.7.2
- Fix · GHSA-cpgf-5mjf-73p7 rails-html-sanitizer (RubyGems) Fixed in 1.7.2 Advisory →
Timeline
- 2026-11-13 Threatist record created from CVE-2026-128068
- 2026-11-13 Alias added: GHSA-cpgf-5mjf-73p7
- 2026-11-13 Fix available: RubyGems/[email protected] · GHSA-cpgf-5mjf-73p7
- 2026-11-13 CVSS score added · GHSA-cpgf-5mjf-73p7
- 2026-11-13 Weakness changed · GHSA-cpgf-5mjf-73p7
- 2026-11-13 5 new references · GHSA-cpgf-5mjf-73p7
- 2026-11-16 CISA SSVC decision points changed
References
Other 5
- https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-cpgf-5mjf-73p7
- https://github.com/rails/rails-html-sanitizer/commit/f776f963b9d9346271aade9cb903e793fd38e865
- https://github.com/rails/rails-html-sanitizer/releases/tag/v1.7.2
- https://github.com/rails/rails-html-sanitizer
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/GHSA-cpgf-5mjf-73p7.yml
More Rails vulnerabilities
- TI-2014-00124 Path traversal in Ruby on Rails lets remote attackers read files KEVCVSS 3.1HIGH 7.5
- TI-2019-03828 File content disclosure in Rails Action View KEVCVSS 3.1HIGH 7.5
- TI-2016-00672 Directory traversal in Rails Action View lets attackers read files KEVCVSS 3.1HIGH 7.5
- TI-2019-03830 Command injection in Rails https://github.com/rails/rails CVSS 3.1CRITICAL 9.8
- TI-2026-47043 Action Pack: Possible arbitrary file read and remote code execution in Active Storage variant processing CVSS 4.0CRITICAL 9.5
- TI-2025-18040 Command injection in Rails activestorage CVSS 4.0CRITICAL 9.2
Sources
- CVE-2026-128068 · CVE Program
- CVE-2026-128068 · NVD
- FIRST EPSS
- GHSA-cpgf-5mjf-73p7 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences