Skip to main content

Loofah CVE-2026-73491

| EUVDEUVD-2026-57628 LOW
Incomplete List of Disallowed Inputs (CWE-184)
2026-08-12 GitHub_M
2.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit URL with 	 in scheme
  2. Delivery
    Pass HTML-encoded string to allowed_uri?
  3. Exploit
    Method approves javascript: URI (bypass)
  4. Execution
    Application renders URL into href attribute
  5. Persist
    Victim clicks link, browser strips tab character
  6. Impact
    XSS executes in victim browser session

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation completeness
Exploitation Conditions

Exploitation requires that the target application calls Loofah::HTML5::Scrub.allowed_uri? directly with a user-controlled HTML-encoded string - this is an explicitly non-default usage pattern. Loofah's standard sanitize() pipeline is not vulnerable because Nokogiri decodes HTML entities at the DOM parsing stage before URI scheme evaluation, preventing the bypass. The bypass is limited to exactly two named character references: 	 (U+0009) and 
 (U+000A), which are the only HTML5 named references that decode to characters the WHATWG URL parser strips from URLs;   and other named references cannot be used. Affected higher-level features include Action Text 8.2 markdown link validation. Limiting factors: only Loofah 2.25.0-2.25.1 is affected (prior versions and 2.25.2+ are not); applications must render the approved URL into a browser-interpreted URI attribute such as href for XSS impact to materialize; and CVSS PR:L indicates the attacker needs at least some access level to submit a URL for validation.

Impact

The CVSS 4.0 score of 2.3 (AV:N/AC:H/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L) accurately captures the constrained attack surface: the vulnerability is network-reachable but requires high attack complexity because exploitation depends on a non-default application pattern - directly calling allowed_uri? with HTML-encoded strings rather than routing through sanitize(). The subsequent-system impact metrics (SC:L/SI:L) reflect XSS reaching the victim's browser rather than the server itself. No CISA KEV listing and no public exploit code identified, indicating this is not under active widespread exploitation. EPSS data was not provided; given the narrow applicability (only direct allowed_uri? callers), opportunistic mass exploitation is unlikely. The real-world priority is highest for Rails applications using Action Text 8.2 markdown link validation, which is a confirmed affected higher-level feature. For the majority of Loofah consumers using the default sanitize() path, this vulnerability does not apply.

Exploit ScenarioDerived

An attacker submits the URL java	script:alert(document.cookie) through a feature that calls Loofah::HTML5::Scrub.allowed_uri? directly, such as Action Text 8.2 markdown link validation. The method returns true because CGI.unescapeHTML leaves 	 intact and the scheme regex does not match javascript:. The application renders the approved URL into an href attribute; when a victim clicks the link, the browser's WHATWG URL parser strips the tab character and executes the javascript: payload in the victim's session. The proof-of-concept payloads are fully documented in the vendor advisory GHSA-8whx-365g-h9vv, though no standalone public exploit tool has been identified.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 12, 2026

Cross-site scripting bypass in Loofah 2.25.0-2.25.1 allows attackers to smuggle javascript: URIs past the allowed_uri? helper by inserting HTML5 named whitespace character references (	 or 
) into the scheme. This is a partial bypass of the earlier fix for GHSA-46fp-8f5p-pf2m, which patched numeric character references but not named forms. Only callers that invoke allowed_uri? directly with HTML-encoded strings are vulnerable - including Action Text 8.2 markdown link validation - while Loofah's default sanitize() pipeline is explicitly unaffected. No public exploit identified at time of analysis; vendor-released patch in version 2.25.2.

RemediationAI

Upgrade to Loofah 2.25.2, which is the vendor-released patch resolving this issue. The tagged release is available at https://github.com/flavorjones/loofah/releases/tag/v2.25.2 and the fix commit is at https://github.com/flavorjones/loofah/commit/5e91af861e3cdab47b91dd0b81f3afdfd13a5e19. For applications unable to upgrade immediately, the most effective compensating control is to avoid passing raw HTML-encoded strings directly to Loofah::HTML5::Scrub.allowed_uri? - route URI validation through Loofah's standard sanitize() pipeline instead, which is confirmed unaffected because Nokogiri decodes entities during DOM parsing before allowed_uri? is ever invoked. Alternatively, pre-process the string with an HTML5-aware decoder (not CGI.unescapeHTML) before passing it to allowed_uri?. Applications using Action Text 8.2 should treat this as a priority upgrade given that feature's confirmed use of the affected code path.

Affected VersionsENISA

loofah 2.25.0, < 2.25.2

Affected Packages

rubygems loofah fix: 2.25.2

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 sanitization library (RubyGems: loofah, CPE: cpe:2.3:a:flavorjones:loofah:*:*:*:*:*:*:*:*) built on Nokogiri, heavily used in Rails applications. The root cause is CWE-184 (Incomplete List of Disallowed Inputs): allowed_uri? calls CGI.unescapeHTML to decode entities before checking for forbidden schemes, but CGI.unescapeHTML only handles numeric character references (e.g., &#9;) and leaves HTML5 named character references (&Tab;, &NewLine;) intact. The WHATWG URL parser implemented in all modern browsers strips U+0009 (tab) and U+000A (line feed) from URLs before scheme evaluation, so a payload like java&Tab;script:alert(1) is approved by allowed_uri? yet executed as javascript: by the browser. Only &Tab; and &NewLine; are exploitable this way - &nbsp; decodes to U+00A0, which browsers do not strip. The fix in 2.25.2 adds an explicit WHITESPACE_CHARACTER_REFERENCES regex to strip these named references prior to scheme evaluation, alongside a new decode_numeric_character_references method for more complete numeric reference handling.

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

Vendor (GitHub_M) PRIMARY 2.3 LOW
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
vuln.today AI 4.9 MEDIUM

AC:H because exploitation requires non-default direct `allowed_uri?` usage with HTML-encoded input; PR:L for attacker URL submission access; S:C and C:L/I:L for downstream XSS browser impact.

3.1 AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Aug 12, 2026 - 22:03 EUVD

DescriptionCVE.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: URIs whose scheme is split or prefixed with the HTML5 named whitespace character references &Tab; or &NewLine;. CGI.unescapeHTML leaves those references intact, so allowed_uri? reports the URL safe even though a browser decodes and strips the tab or line feed and executes the resulting javascript: URL. 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

EPSS Score
0.2%
Top 84% exploitable
Prevalence
Medium
popular Ruby HTML sanitization gem, core dependency in many Rails apps
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

12
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +12
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy