# CVE-2026-126206: Loofah HTML5 Scrub XSS bypass via HTML entity encoding in data URIs

Source: https://junglewise.ai/threats/cve-2026-126206-loofah-allowed-uri-treats-data-text-sol-html-as-safe-text-plain  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-11-12. Updated: 2026-11-12  
License: CC BY 4.0 with a link back

CVE-2026-126206 · Severity: medium · Published 2026-11-12

Loofah is a library that sanitizes HTML to prevent malicious content. An attacker can bypass its URI validation by encoding special characters as HTML entities (like &sol; for /), causing the library to misidentify a data:text/html URI as the safe text/plain type. This could allow injected JavaScript to execute in users' browsers when an application uses Loofah to validate user-supplied URLs.

Technologies: [Loofah](https://junglewise.ai/threats/technologies/loofah-loofah), [loofah (RubyGems)](https://junglewise.ai/threats/technologies/loofah). Vendors: [Loofah](https://junglewise.ai/threats/vendors/loofah), [Ruby on Rails](https://junglewise.ai/threats/vendors/ruby-on-rails), [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2026-126206 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-126206 being exploited in the wild.

**How severe is CVE-2026-126206?** Medium severity, published 12 November 2026.

**Which products and versions are affected?** Loofah before 2.25.3; Ruby on Rails Rails::HTML::Sanitizer unknown; loofah (RubyGems) = 2.25.2.

**Is there a fix for CVE-2026-126206?** Yes: fixed in Loofah 2.25.3. Until then: Upgrade Loofah to version 2.25.3 or later. Note that the default sanitize() path is not affected as Nokogiri decodes entities during parsing; only direct callers of the allowed_uri? helper with HTML-encoded input are vulnerable. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-126206 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-126206?** Check whether you run Loofah, Ruby on Rails Rails::HTML::Sanitizer or loofah (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in Loofah 2.25.3

Upgrade Loofah to version 2.25.3 or later. Note that the default sanitize() path is not affected as Nokogiri decodes entities during parsing; only direct callers of the allowed_uri? helper with HTML-encoded input are vulnerable.

## Technical details

The allowed_uri? method uses CGI.unescapeHTML which only decodes numeric character references, not HTML5 named character references. When &sol; survives normalization, the MIME type lacks a forward slash and is treated as malformed, falling back to the allowed text/plain type. A browser decoding the same entity reads it as text/html, creating a parsing divergence that enables XSS injection via crafted data URIs using &colon;, &sol;, &Tab;, or &NewLine; entities.

## Affected products

- Loofah Loofah before 2.25.3
- Ruby on Rails Rails::HTML::Sanitizer unknown

## Identifiers

- CVE-2026-126206
- GHSA-jcff-cj73-4w4f

## Timeline

- 2026-11-12: disclosed

## Related threats

- [Loofah allowed_uri? XSS bypass via numeric character reference](https://junglewise.ai/threats/cve-2026-126209-loofah-is-a-general-library-for-manipulating-and-transforming)
- [Loofah SVG href sanitization bypass in textPath and mpath](https://junglewise.ai/threats/cve-2026-126208-loofah-is-a-general-library-for-manipulating-and-transforming)
- [Loofah CSS url() sanitization bypass via escaped parentheses](https://junglewise.ai/threats/cve-2026-126207-loofah-css-url-sanitization-bypass-via-escaped-parentheses)
- [Loofah regular expression denial of service in SVG local-reference check](https://junglewise.ai/threats/cve-2026-126205-loofah-regular-expression-denial-of-service-in-the-svg-local)
- [Loofah HTML5 scrubber markup injection with Nokogiri](https://junglewise.ai/threats/cve-2026-126203-loofah-is-a-general-library-for-manipulating-and-transforming)
