GHSA-cj75-f6xr-r4g7
MediumSummary
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.
Risk Assessment
An attacker can inject malicious JavaScript code via the SVG <use> element, leading to XSS attacks on application users.
Recommendation
Update the rails-html-sanitizer gem to a version that includes a fix restricting attributes in SVG reference elements.
Other vulnerabilities in rails-html-sanitizer
See all- 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-128068Medium
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.
- 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)
## Summary 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>. See related GHSA-9wjq-cp2p-hrgf in Loofah, whose SVG local-reference logic rails-html-sanitizer mirrors.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

