Description
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. From 2.25.0 until 2.25.2, Loofah::HTML5::Scrub.allowed_uri? does not reject javascript: URIs whose scheme is split or prefixed with the HTML5 named whitespace character references 	 or 
. CGI.unescapeHTML leaves those references intact, so allowed_uri? reports the URL safe even though a browser decodes and strips the tab or line feed and executes the resulting javascript: URL. This issue affects only callers that pass HTML-encoded strings directly to allowed_uri?; Loofah's default sanitize() path is not affected. This issue is fixed in version 2.25.2.
Published: 2026-08-12
Score: 2.3 Low
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The Loofah 2.25.0‑2.25.1 library contains a flaw in the allowed_uri? method. It fails to reject javascript: URLs that are split or prefixed with the HTML5 named whitespace character references 	 or 
. This omission allows an attacker that supplies HTML‑encoded input to traverse the library as if it were safe, while browsers later decode and execute the resulting javascript: URI, enabling arbitrary client‑side script execution. The weakness corresponds to CWE‑184 and results in a cross‑site scripting or client‑side code execution vulnerability.

Affected Systems

Vendors: flavorjones: Loofah. Versions impacted: 2.25.0 and 2.25.1. The problem appears only when callers pass HTML-encoded strings directly to Loofah::HTML5::Scrub.allowed_uri?; Loofah's default sanitize() path remains unaffected. All other versions are considered safe.

Risk and Exploitability

The vulnerability earned a CVSS score of 2.3, indicating low severity. With no EPSS data available and no listing in the CISA KEV catalog, the risk of exploitation appears low under normal circumstances, but it can be triggered when an application directly invokes allowed_uri? on encoded data. Attackers must have the ability to supply such input—common in content‑creation or user‑generated data scenarios—after which the browser will execute the embedded JavaScript.

Generated by OpenCVE AI on August 13, 2026 at 02:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Update to Loofah 2.25.2 or later to apply the fix.
  • Review application code to ensure that no direct calls to Loofah::HTML5::Scrub.allowed_uri? are made with HTML‑encoded input.
  • Prefer using the library’s default sanitization path (Scrub.default_sanitize) when cleaning user‑supplied content, as it avoids the vulnerable method.

Generated by OpenCVE AI on August 13, 2026 at 02:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8whx-365g-h9vv Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references
History

Wed, 12 Aug 2026 21:00:00 +0000

Type Values Removed Values Added
Description Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. From 2.25.0 until 2.25.2, Loofah::HTML5::Scrub.allowed_uri? does not reject javascript: URIs whose scheme is split or prefixed with the HTML5 named whitespace character references 	 or 
. CGI.unescapeHTML leaves those references intact, so allowed_uri? reports the URL safe even though a browser decodes and strips the tab or line feed and executes the resulting javascript: URL. This issue affects only callers that pass HTML-encoded strings directly to allowed_uri?; Loofah's default sanitize() path is not affected. This issue is fixed in version 2.25.2.
Title Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references
Weaknesses CWE-184
References
Metrics cvssV4_0

{'score': 2.3, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-12T20:59:18.589Z

Reserved: 2026-08-12T19:00:33.735Z

Link: CVE-2026-73491

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-12T21:17:42.273

Modified: 2026-08-12T21:17:42.273

Link: CVE-2026-73491

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-13T02:45:03Z

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs