Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

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

0
Low
Published: 07/21/2026 (07/21/2026, 22:03:11 UTC)
Source: GCVE Database
Product: loofah

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.

CVSS v4.0

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
None
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

Affected software

RubyGemsghsa
loofah
Affected versions
>=2.25.0 <2.25.2

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:37:50 UTC

Technical Analysis

The Loofah Ruby gem's allowed_uri? method does not properly reject javascript: or vbscript: URIs if the scheme is obfuscated using numeric character references lacking trailing semicolons (e.g., &#58 instead of &#58;). While allowed_uri? uses CGI.unescapeHTML which only decodes numeric character references with semicolons, browsers decode these references even without semicolons, causing the scheme to be interpreted as executable javascript:. This discrepancy allows bypassing the URI scheme validation, leading to potential XSS when user-controlled URLs validated by allowed_uri? are rendered in HTML attributes. The default Loofah sanitize() method is unaffected because Nokogiri decodes entities before Loofah processes URIs. The vulnerability affects Loofah versions >=2.25.0 and <2.25.2 and was responsibly disclosed by GitHub user @MoonFuji.

Potential Impact

Applications that use Loofah's allowed_uri? method to validate user-supplied URLs before rendering them into href or other URI attributes may be vulnerable to cross-site scripting (XSS) attacks. This includes direct calls to allowed_uri? and higher-level features relying on it, such as Action Text 8.2's markdown link validation. The vulnerability allows malicious javascript: URIs to bypass validation due to incomplete decoding of numeric character references, potentially enabling script execution in the browser.

Mitigation Recommendations

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-5qhf-9phg-95m2
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["RubyGems"]
Database Specific Severity
LOW
Cvss Version
4.0

Threat ID: 6a600aa09c2644c7f8fdfa7f

Added to database: 07/22/2026, 00:11:12 UTC

Last enriched: 07/22/2026, 00:37:50 UTC

Last updated: 07/22/2026, 03:53:13 UTC

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses