Skip to main content
VulnerabilityPublished

Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons

Affects loofahSource GCVE Database

0

CVSS 2.3 Low : upgrade to 2.25.2 when convenient.

Data as of 22 Jul 2026, 00:37 UTC

CVSS 4.0 base score
2.3Low
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 2.25.2
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

What to do

Upgrade loofah to 2.25.2.

Affected software

ProductAffectedFixed in
RubyGemsloofahAffected
  • >=2.25.0 <2.25.2
Fixed in
  • 2.25.2

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Upgrade Loofah to version 2.25.2 or later, where this issue is fixed. The vendor advisory explicitly states that upgrading to Loofah >= 2.25.2 mitigates the vulnerability. No other mitigation actions are indicated.

Description

Loofah's allowed_uri? method fails to detect javascript: or vbscript: URIs when the scheme is split by numeric character references without trailing semicolons. Browsers decode these references and execute the URI, but allowed_uri? incorrectly marks them as safe. This affects callers that validate user-controlled URLs with allowed_uri? and then render them into browser-interpreted URI attributes, potentially enabling cross-site scripting (XSS). The default sanitize() method is not affected. The issue is fixed in Loofah version 2.25.2.

References

Community reviews

Loading reviews…