Vulnerability GHSA-h6v6-rg66-fqj4

Medium Risk
MEDIUM RISK
CVSS Score: 6.1
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
20 hours ago
November 12, 2026 at 08:52 PM UTC
Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values
2.21.0 - 2.25.2
2.21.0 - 2.25.2

Summary

Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values

Details

Summary

Loofah's HTML5 scrubbers could emit output that a browser parses into different markup, allowing mutation XSS. Nokogiri < 1.19.5 did not escape < and > in attribute values. When the output contained certain MathML, a browser treated markup inside an allowed attribute as live HTML. The :strip scrubber is affected in every browser. The :prune and :escape scrubbers are affected in WebKit browsers such as Safari.

Nokogiri 1.19.5 escapes < and > in attribute values, as the HTML standard requires. Loofah 2.25.3 requires Nokogiri >= 1.19.5.

Impact

Applications that sanitize untrusted HTML with Loofah's HTML5 API (Loofah.html5_fragment, Loofah.html5_document and the scrub_html5_* methods) and display the result to other people are affected, including with the default allowlist.

Not affected: Loofah's HTML4 API (including Loofah::Helpers.sanitize), the :whitewash scrubber, rails-html-sanitizer's default configuration, and JRuby.

Mitigation

Upgrade to Loofah >= 2.25.3, or upgrade Nokogiri to >= 1.19.5.

Impacted packages

Timeline

Published
20 hours ago
November 12, 2026 at 08:52 PM UTC
Fixed (2.25.3)
11 days ago
November 02, 2026 at 05:00 AM UTC
Last Modified
19 hours ago
November 12, 2026 at 09:00 PM UTC