Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons
Affects loofahSource GCVE Database
CVSS 2.3 Low : upgrade to 2.25.2 when convenient.
Data as of 22 Jul 2026, 00:37 UTC
- 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:NWhat to do
Upgrade loofah to 2.25.2.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| RubyGemsloofah | Affected
| Fixed in
|
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
- github.com/flavorjones/loofah/security/advisories/GHSA-5qhf-9phg-95m2 (opens in a new tab)
- github.com/flavorjones/loofah/commit/f1be9d893b5a8dd79240441a912d8897e74c38c0 (opens in a new tab)
- github.com/flavorjones/loofah (opens in a new tab)
- github.com/flavorjones/loofah/releases/tag/v2.25.2 (opens in a new tab)