Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit HTML-encoded javascript: URI
-
Deliveryallowed_uri? misses encoded scheme via CGI gap
-
ExploitApplication stores approved href
-
ExecutionVictim loads page with injected attribute
-
PersistBrowser decodes numeric reference
-
Impactjavascript: payload executes in victim session
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 the application to call |
| Impact | The CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N, score 2.3) reflects the narrow attack surface accurately: high attack complexity is warranted because exploitation is gated on a non-default, direct call to |
| Exploit ScenarioDerived | An attacker submits a crafted URL such as |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Aug 12, 2026
Cross-site scripting in Loofah 2.25.0-2.25.1 is possible when applications call Loofah::HTML5::Scrub.allowed_uri? directly with HTML-encoded strings, because the method fails to detect javascript: or vbscript: schemes disguised via semicolon-less numeric character references such as : (colon) or 	 (tab). This is a bypass of the prior fix in GHSA-46fp-8f5p-pf2m, which covered semicoloned references (:) but not the semicolon-less form that browsers still decode and execute. Loofah's default sanitize() path is not affected; only direct callers of the string-level allowed_uri? API - including Action Text 8.2's markdown link validation - are at risk. No public exploit identified at time of analysis; CVSS 4.0 scores this 2.3, reflecting narrow attack surface and high exploitation complexity.
RemediationAI
Upgrade to Loofah 2.25.2, confirmed as the fix release via the official GitHub release tag and GHSA-5qhf-9phg-95m2 advisory (https://github.com/flavorjones/loofah/releases/tag/v2.25.2). In a Bundler-managed project, run bundle update loofah and verify the resolved version in Gemfile.lock. If an immediate upgrade is blocked, the primary workaround is to stop passing HTML-encoded strings directly to Loofah::HTML5::Scrub.allowed_uri?; instead, ensure user-controlled URL input is pre-decoded by a browser-equivalent HTML parser before reaching allowed_uri?, or restrict accepted input to plain (non-HTML-encoded) URL strings at the application boundary. Applications that exclusively use Loofah's sanitize() method require no action and are not affected. The patch diff is available at https://github.com/flavorjones/loofah/commit/f1be9d893b5a8dd79240441a912d8897e74c38c0 for teams that need to audit the specific code change.
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 (cpe:2.3:a:flavorjones:loofah:*:*:*:*:*:*:*:*) is a Ruby gem for HTML/XML sanitization built on Nokogiri, widely used in the Rails ecosystem. The vulnerable code path is Loofah::HTML5::Scrub.allowed_uri?, which normalizes URI strings by calling CGI.unescapeHTML before applying a scheme-detection regex. The root cause (CWE-79) is a parser-browser discrepancy: CGI.unescapeHTML decodes numeric character references only when they carry a trailing semicolon, matching the strict HTML5 parsing spec, but browsers decode semicolon-less forms such as : → : and 	 → tab (then strip it). This means javascript:alert(1) passes allowed_uri? (no recognized scheme is found) yet executes as javascript:alert(1) in a browser. The fix in 2.25.2 introduces a decode_numeric_character_references helper that normalizes both forms - with and without semicolons - before scheme detection, and also strips HTML5 named whitespace references (	, 
) that CGI.unescapeHTML also leaves encoded. Nokogiri's own parser decodes entities during DOM construction, which is why the sanitize() path is immune.
Know when Loofah 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:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
High complexity because non-default direct API usage is required; user interaction needed for stored XSS to execute; scope change from server to browser context with low confidentiality and integrity impact.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.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.2, Loofah::HTML5::Scrub.allowed_uri? does not reject javascript: or vbscript: URIs whose scheme is split by semicolon-less numeric character references such as :, 	, 
, or 
. CGI.unescapeHTML leaves these references encoded, so allowed_uri? reports the URL safe even though a browser decodes an encoded colon or strips encoded whitespace and executes the resulting URI scheme. 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.
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.
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Rated medium severity (CVSS 6.1
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in sanitized output by republishing
In the Loofah gem for Ruby through v2.3.0 unsanitized JavaScript may occur in sanitized output when a crafted SVG elemen
In the Loofah gem for Ruby, through v2.2.2, unsanitized JavaScript may occur in sanitized output when a crafted SVG elem
SVG href attribute bypass in Loofah prior to 2.25.2 allows a crafted sanitized SVG to reference arbitrary same-origin ex
Cross-site scripting bypass in Loofah 2.25.0-2.25.1 allows attackers to smuggle `javascript:` URIs past the `allowed_uri
EUVD-2026-57629
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB