Read the docs

Regular expression denial of service in rails-html-sanitizer

Priority LOW 30CWE-1333Published · Updated

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

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00453 39th percentileScored 2026-11-16
Fix Fixed rails-html-sanitizer (rails): 1.7.2rails-html-sanitizer (RubyGems): 1.7.2

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

VendorProductAffected versionsFixed inStatusSource
Railsrails-html-sanitizer1.0.3 to before 1.7.21.7.2Patch availableCNA
—rails-html-sanitizer (RubyGems)1.0.3 to before 1.7.21.7.2Patch availableGHSA-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

  1. 2026-11-13 Threatist record created from CVE-2026-128068
  2. 2026-11-13 Alias added: GHSA-cpgf-5mjf-73p7
  3. 2026-11-13 Fix available: RubyGems/[email protected] · GHSA-cpgf-5mjf-73p7
  4. 2026-11-13 CVSS score added · GHSA-cpgf-5mjf-73p7
  5. 2026-11-13 Weakness changed · GHSA-cpgf-5mjf-73p7
  6. 2026-11-13 5 new references · GHSA-cpgf-5mjf-73p7
  7. 2026-11-16 CISA SSVC decision points changed

References

  • 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
See all 185 →

Sources