Skip to main content

CVE-2026-126203 — Loofah: Mutation XSS in loofah — CVE Details

MEDIUM

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

Published November 12, 2026Updated November 12, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.35%). Schedule for your next planned update.

Does your project use an affected loofah version?

Paste your Gemfile.lock to check it for CVE-2026-126203 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Gemfile.lock

Summary

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.

Advisory Timeline

  • First published November 12, 2026 (14 days ago).
  • Last revised November 12, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update loofah to 2.25.3 or later
gem install loofah -v 2.25.3

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: RubyGems (1).

PackageFixed In
loofah RubyGems · Affected: 2.21.0, 2.21.1, 2.21.2, 2.21.3 (+9 more)2.25.3

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-116
    Improper Encoding or EscapingMITRE
  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Frequently Asked Questions

What is CVE-2026-126203?
Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
How do I check if my project is affected by CVE-2026-126203?
CVE-2026-126203 affects loofah. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-126203 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.1

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.35%
EPSS percentile: 21.5

This is a below-median EPSS score — only 21.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-h6v6-rg66-fqj4

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock