Skip to main content

Loofah EUVDEUVD-2026-124716

| CVE-2026-126209 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-12 security-advisories@github.com GHSA-p9wj-w8xq-vjx6
5.3
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Craft URL with semicolon-less numeric reference colon
  2. Delivery
    Submit to app calling allowed_uri? directly
  3. Exploit
    Whitespace strip mis-decodes reference, hides scheme
  4. Execution
    Approved value rendered into href attribute
  5. Impact
    Victim 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&#x3a alert(1)' or '&#x6a\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&#x3a 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&#x3a 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – 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

loofah 2.25.0, < 2.25.3

Affected Packages

rubygems loofah fix: 2.25.3

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 &#x3a ends at the first character that cannot extend it, so a browser parsing 'javascript&#x3a 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 '&#x3aa' as U+03AA instead of a colon, so no scheme is detected and the value is approved. The same technique works with decimal references (&#58) and with references that encode individual scheme letters, for example '&#x6a\tavascript:alert(1)' or '&#x76\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

Vendor (github) PRIMARY 5.3 MEDIUM
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
vuln.today AI 6.1 MEDIUM

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.

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
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

2
Patch available
Nov 12, 2026 - 22:02 EUVD
CVE Published
Nov 12, 2026 - 21:17 cve.org
MEDIUM 5.3

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.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

EPSS Score
0.4%
Top 64% exploitable
Prevalence
High
Loofah is a widely deployed Ruby/Rails HTML sanitization library
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
High

Priority Score

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

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

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

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2026-44266 CRITICAL POC
9.8 Nov 03

Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

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

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

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

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

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

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