# CVE-2026-73491: Loofah HTML5 Scrub javascript URI scheme bypass

Source: https://junglewise.ai/threats/cve-2026-73491-loofah-html5-scrub-javascript-uri-scheme-bypass  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-12. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-73491 · Severity: medium · CVSS 4 · Published 2026-08-12

Loofah is a library that cleans and sanitizes HTML/XML documents to prevent malicious content. A vulnerability in versions 2.25.0 through 2.25.1 allows attackers to bypass URL validation by encoding whitespace characters in javascript: URIs, which browsers decode and execute. This affects only direct calls to the validation function with HTML-encoded input; the default sanitization path is not affected. The issue is fixed in version 2.25.2.

Technologies: [loofah (RubyGems)](https://junglewise.ai/threats/technologies/loofah). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

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

**How severe is CVE-2026-73491?** Medium severity, with a CVSS score of 4, published 12 August 2026.

**Which products and versions are affected?** loofah (RubyGems) ECOSYSTEM:introduced=2.25.0,fixed=2.25.2.

**Is there a fix for CVE-2026-73491?** Yes. loofah (RubyGems): upgrade to 2.25.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-73491 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-73491?** Check whether you run 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

- loofah (RubyGems): upgrade to 2.25.2 or later

  ```sh
  bundle update loofah
  ```


## Technical details

The vulnerability exists in the Loofah::HTML5::Scrub.allowed_uri? method, which is responsible for validating whether URIs are safe to include in sanitized HTML. The method fails to properly handle HTML5 named whitespace character references (&Tab; and &NewLine;) that prefix or split javascript: URI schemes. While CGI.unescapeHTML leaves these character references intact, browsers decode and strip them when rendering, allowing the resulting javascript: URL to execute. The issue only impacts callers who directly pass HTML-encoded strings to allowed_uri?; Loofah's default sanitize() function is unaffected. The fix was implemented in version 2.25.2 to properly decode and reject these obfuscated URIs.

## Affected products

- Loofah Loofah 2.25.0 through 2.25.1

## Identifiers

- CVE-2026-73491
- GHSA-8whx-365g-h9vv

## Timeline

- 2026-07-15: patched: Fixed in version 2.25.2

## References

- [https://github.com/flavorjones/loofah/commit/5e91af861e3cdab47b91dd0b81f3afdfd13a5e19](https://github.com/flavorjones/loofah/commit/5e91af861e3cdab47b91dd0b81f3afdfd13a5e19)
- [https://github.com/flavorjones/loofah/pull/308](https://github.com/flavorjones/loofah/pull/308)

## 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 HTML5 Scrub XSS bypass via HTML entity encoding in data URIs](https://junglewise.ai/threats/cve-2026-126206-loofah-allowed-uri-treats-data-text-sol-html-as-safe-text-plain)
- [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)
