CVE-2026-128068
MediumCVSS 5.3Exploitation Probability (EPSS)
Low risk41th percentile - higher than 41% of all known CVEs
Summary
rails-html-sanitizer versions 1.0.3 through 1.7.1 contain a resource exhaustion vulnerability where SVG href and xlink:href local references are checked with a pattern that causes quadratic CPU consumption on all-whitespace values. An attacker can supply crafted HTML if the application customizes 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, and the issue is fixed in version 1.7.2.
Risk Assessment
An attacker can cause excessive CPU consumption and degrade or deny availability of a Rails application that uses a custom configuration allowing SVG reference elements. Environments running CRuby 3.1 or earlier and JRuby are affected.
Recommendation
Upgrade rails-html-sanitizer to version 1.7.2 or later. If upgrading is not possible, consider removing SVG reference elements (e.g. use) and href/xlink:href attributes from the allowed tags list.
Other vulnerabilities in rails-html-sanitizer
See all- GHSA-cj75-f6xr-r4g7Medium
There is a possible cross-site scripting vulnerability in rails-html-sanitizer when the sanitizer is configured to allow an SVG reference element such as <use>. This is related to GHSA-9wjq-cp2p-hrgf in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors.
- CVE-2026-128069Medium
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Before 1.7.2, the HTML4 and HTML5 variants of Rails::HTML::SafeListSanitizer reuse one Rails::HTML::PermitScrubber across calls and mutate its tags and attributes without synchronization. In a multithreaded process, concurrent sanitize calls using different tags: or attributes: options can interleave and cause one call to use the other call's allowlist. If a permissive call admits a script element or event-handler attribute, output expected to be sanitized under a stricter policy can retain it and cause cross-site scripting when rendered. Applications that are single-threaded, use one identical allowlist everywhere, or provide a separate scrubber: are not affected. This issue is fixed in version 1.7.2.
- CVE-2026-73648Medium
rails-html-sanitizer from 1.0.3 until 1.7.1 restricted SVG reference elements in SVG_ALLOW_LOCAL_HREF only when they used xlink:href, even though browsers also accept the plain href attribute. Applications with non-default allowed tags that included SVG use or feImage elements could therefore permit external references; a same-origin external SVG referenced by use could execute scripts in the sanitized document's context, while feImage could load external images for tracking. Applications using the default allowed tags are not affected. This issue is fixed in version 1.7.1.
Original NVD description (English source)
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.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

