Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft URL with semicolon-less numeric reference colon
-
DeliverySubmit to app calling allowed_uri? directly
-
ExploitWhitespace strip mis-decodes reference, hides scheme
-
ExecutionApproved value rendered into href attribute
-
ImpactVictim loads page, browser executes javascript: XSS
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a non-default integration pattern: the application must call the public string-level helper Loofah::HTML5::Scrub.allowed_uri? (or the re-exported Rails::HTML::Sanitizer.allowed_uri?) on an HTML-encoded, attacker-controlled URL and then render the approved value into an href or other browser-interpreted URI attribute. The affected versions are Loofah 2.25.0 through 2.25.2 (fixed in 2.25.3). Key limiting factors: Loofah's default sanitize() path is NOT vulnerable because Nokogiri decodes entities before URI evaluation; success also requires victim interaction (UI:P) - the crafted attribute must be loaded/followed in a browser that reconstructs the semicolon-less numeric character reference. The trigger payload is a scheme split by a semicolon-less numeric reference terminated by a stripped whitespace/control character (e.g. 'javascript: alert(1)' or 'j\tavascript:alert(1)'). |
| Impact | This is a genuine but moderate-priority XSS sanitizer-bypass, not a drop-everything emergency. The input CVSS 4.0 score is 5.3 (AV:N/AC:L/AT:N/PR:N/UI:P), reflecting network reach and no attacker privileges but requiring victim interaction (UI:P) and yielding only low subsequent-system confidentiality/integrity impact (SC:L/SI:L) - consistent with reflected XSS in a victim's browser rather than server compromise. The vuln.today decision label is 'this_month' (not act_now/emergency), so remediation should be scheduled this cycle rather than treated as a live incident. No EPSS score and no CISA KEV entry are present in the input, and there is no confirmed active exploitation. The GitHub advisory and patch commit publish the exact bypass payloads (e.g. 'javascript: alert(1)'), so a public demonstrator exists even though no weaponized app-level exploit is confirmed. The single most important risk-limiting signal is that exploitability is conditional: Loofah's default sanitize() path is explicitly NOT affected because Nokogiri decodes entities before URI evaluation - only applications that call the public string helper allowed_uri? (or Rails::HTML::Sanitizer.allowed_uri?) on HTML-encoded user input and then render the approved value are exposed. This conditional prerequisite is not expressible in the CVSS vector and materially lowers real-world risk below what the raw mechanism (XSS in a ubiquitous Ruby sanitization library) would suggest. |
| Exploit ScenarioDerived | An application validates a user-supplied URL by calling Loofah::HTML5::Scrub.allowed_uri? (or Rails::HTML::Sanitizer.allowed_uri?) on the raw HTML-encoded string, then places the approved value into an href attribute. An attacker submits 'javascript: alert(1)': allowed_uri? strips the trailing space before decoding, mis-decodes the semicolon-less numeric reference, fails to detect the javascript: scheme, and approves it; when a victim loads the page, the browser reconstructs the colon and executes the script. Public proof-of-concept payloads exist in the advisory and patch commit, but they are demonstrator strings, not a verified working end-to-end exploit. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 12, 2026
Loofah 2.25.0 through 2.25.2 can approve a malicious URL as safe when an application validates an HTML-encoded, attacker-controlled string with the public Loofah::HTML5::Scrub.allowed_uri? helper (also re-exported as Rails::HTML::Sanitizer.allowed_uri?) and then renders the approved value into an href or similar browser-interpreted URI attribute, enabling cross-site scripting in the victim's browser. The flaw is an order-of-operations bug in the URI check rather than a break in Loofah's sanitizer: the default sanitize() path is not affected because Nokogiri decodes entities during parsing before the URI is evaluated. Only non-default integration patterns are exposed, the attacker needs the crafted attribute to be loaded or followed by a victim, no public exploit code was identified at time of analysis, and this is treated as a moderate-priority sanitizer bypass patched in 2.25.3 rather than an emergency.
RemediationAI
Vendor-released patch: upgrade Loofah to 2.25.3, which decodes character references before stripping whitespace and control characters; the fix landed via pull request https://github.com/flavorjones/loofah/pull/324 (commit 62c04841e8252a1b5373afcd2b89fb9b8279e317) and is documented at https://github.com/flavorjones/loofah/security/advisories/GHSA-p9wj-w8xq-vjx6. Until the gem can be upgraded, stop passing HTML-encoded strings to allowed_uri?: decode entities (for example with CGI.unescapeHTML) before the URI check, or route URL validation through Loofah's default sanitize() path, which is not affected because Nokogiri decodes entities during parsing. As a stopgap, applications can reject any candidate URL containing an ampersand-encoded character reference prior to rendering it into href or another browser-interpreted attribute; the trade-off is false positives for legitimately percent- or entity-encoded URLs, so this should be a temporary filter rather than a permanent rule. Patching remains the only complete fix, since the pre-2.25.3 ordering cannot be made safe by configuration.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Loofah is a Ruby HTML/XML manipulation library built on Nokogiri, and allowed_uri? is the string-level helper used to decide whether a URI carries a dangerous scheme such as javascript: or vbscript:. The root cause maps to CWE-79 (improper neutralization leading to cross-site scripting) with an incomplete-denylist flavor (the advisory also tags CWE-184): the helper strips whitespace and control characters from the input before it decodes numeric character references. In HTML parsing a semicolon-less numeric reference such as : ends at the first character that cannot extend it, so a browser parsing 'javascript: alert(1)' terminates the reference at the space and reconstructs 'javascript: alert(1)'. Loofah, having already deleted that space, lets the reference continue into the following text, decoding 'Ϊ' as U+03AA instead of a colon, so no scheme is detected and the value is approved. The same technique works with decimal references (:) and with references that encode individual scheme letters, for example 'j\tavascript:alert(1)' or 'v\tbscript:msgbox(1)'. The upstream fix (commit 62c04841) reverses the order so numeric references and named entities are decoded first and stripping happens afterwards, matching browser behavior; the accompanying tests also flip an earlier expectation so that control characters embedded inside character references are now allowed, because browsers do not rejoin those into a scheme. No CPE strings were supplied in the intelligence feed, so product identification rests on the RubyGems package rubygems/loofah and the GitHub advisory.
Know when Ruby gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
Remote unauthenticated bypass (AV:N/PR:N) but victim must render the attribute (UI:R); XSS executes in the victim browser causing a scope change (S:C) with limited C/I impact.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
2DescriptionCVE.org
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.3, Loofah::HTML5::Scrub.allowed_uri? strips whitespace and control characters before decoding a semicolon-less numeric character reference, changing where the reference ends and hiding a javascript: or vbscript: scheme that a browser reconstructs. The bypass applies to encoded colons and encoded scheme letters when a stripped character terminates the numeric reference. An application that renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting, and Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes entities before URI evaluation. This issue is fixed in version 2.25.3.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi
Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in
Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub
Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7
Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th
Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w
Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru
EUVD-2026-124716
GHSA-p9wj-w8xq-vjx6
NVD
CVE.org
EPSS
Exploit-DB