CVE Catalog

CVE-2026-126203

MediumCVSS 6.1
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.27%

21th percentile - higher than 21% of all known CVEs

Summary

In Loofah from 2.21.0 to 2.25.3, the HTML5 APIs (Loofah.html5_fragment, Loofah.html5_document, scrub_html5_*) can emit sanitized output that a browser reparses as different markup when used with Nokogiri before 1.19.5 (which does not escape angle brackets in attribute values). MathML can place markup inside an allowed attribute, making the reparsed output live HTML; :strip is affected in all browsers, while :prune and :escape are affected in WebKit.

Risk Assessment

Sanitization bypass and execution of injected HTML/JavaScript in the user's browser (XSS) is possible.

Recommendation

Upgrade Loofah to version 2.25.3 and Nokogiri to version 1.19.5 or later. Check that the application does not use vulnerable version combinations.

Other vulnerabilities in Loofah

See all
Original NVD description (English source)

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. From 2.21.0 until 2.25.3, Loofah's HTML5 APIs Loofah.html5_fragment, Loofah.html5_document, and the scrub_html5_* methods can emit sanitized output that a browser reparses as different markup when used with Nokogiri before 1.19.5, because those Nokogiri versions do not escape angle brackets in attribute values. MathML can place markup inside an allowed attribute so the reparsed output becomes live HTML. The :strip scrubber is affected in every browser, while :prune and :escape are affected in WebKit browsers. Loofah's HTML4 APIs, Loofah::Helpers.sanitize, :whitewash, rails-html-sanitizer's default configuration, and JRuby are not affected. This issue is fixed in version 2.25.3.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS