Skip to main content

Loofah EUVDEUVD-2026-124712

| CVE-2026-126206 MEDIUM
Cross-site Scripting (XSS) (CWE-79)
2026-11-12 GitHub_M GHSA-jcff-cj73-4w4f
5.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Craft data: URI hiding mediatype with /
  2. Delivery
    Submit as user-controlled URL input
  3. Exploit
    Bypass allowed_uri? validation (falls back to text/plain)
  4. Execution
    Approved value rendered into href attribute
  5. Impact
    Victim's browser decodes / and executes script as text/html

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 that the application call the public string-level helper Loofah::HTML5::Scrub.allowed_uri? (or the re-exported Rails::HTML::Sanitizer.allowed_uri?) directly on a user-controlled, HTML-encoded URL string and then render the approved value into an href or other browser-interpreted URI attribute; the specific trigger is a data: URI whose mediatype uses the HTML5 named reference &sol; in place of '/' (e.g. 'data:text&sol;html,<script>alert(1)</script>'), which CGI.unescapeHTML does not decode. Key limiting factors: only Loofah 2.25.2 is affected; the default Loofah sanitize() path is NOT vulnerable because Nokogiri decodes the entity first; and per UI:P a victim must view/activate the rendered attribute for the script to run. The only complete fix per the vendor is upgrading to Loofah >= 2.25.3.

Impact

This is a moderate, conditionally-exploitable sanitizer-bypass XSS rather than a broad emergency. The vendor CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N, 5.3) indicates a network-reachable, low-complexity, unauthenticated issue that requires passive user interaction (a victim viewing the rendered page) and produces only limited subsequent-system confidentiality/integrity impact in the browser - consistent with CWE-79/CWE-184. The decisive limiting signal, confirmed by the GHSA advisory, is that only callers of the public string-level helper Loofah::HTML5::Scrub.allowed_uri? (or the re-exported Rails::HTML::Sanitizer.allowed_uri?) that pass it HTML-encoded strings are affected; Loofah's default sanitize() path is NOT vulnerable because Nokogiri decodes the entity before URI validation. No KEV listing and no EPSS score are present in the input, and no working exploit reference is supplied - only patch/commit/advisory links - so there is no evidence of active exploitation. The vuln.today decision label is 'this_month' (not act_now/emergency), aligning with a plan-and-patch priority. Net: real and worth remediating promptly for apps using the specific helper, but not a widespread drive-by threat against default Loofah usage.

Exploit ScenarioDerived

An attacker submits a user-controlled URL such as 'data:text&sol;html,<script>alert(1)</script>' to an application that validates URLs with Loofah::HTML5::Scrub.allowed_uri? (or Rails::HTML::Sanitizer.allowed_uri?) and then renders the approved value into an href attribute. The helper reads the &sol;-disguised mediatype as malformed and falls back to the allowed text/plain, but the victim's browser decodes &sol; to '/', interprets the URI as text/html, and executes the script when the link is activated/viewed. No working weaponized exploit is published; the advisory provides only illustrative payload strings.

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

A sanitizer bypass in the Ruby gem Loofah 2.25.2 lets a crafted data: URI slip past Loofah::HTML5::Scrub.allowed_uri? (also re-exported as Rails::HTML::Sanitizer.allowed_uri?) and reach a browser-interpreted attribute as live text/html, enabling cross-site scripting. Only applications that call this public string-level helper directly on user-controlled, HTML-encoded URL strings and then render the approved value into href or a similar attribute are exposed - the exploit uses 'data:text&sol;html,...' because Loofah's CGI.unescapeHTML normalization leaves the HTML5 named reference &sol; intact. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation, and the vendor states that only version 2.25.2 is vulnerable. No public exploit code or confirmed active exploitation is identified at time of analysis; the fix ships in Loofah 2.25.3.

RemediationAI

Upgrade to Loofah 2.25.3 or later (vendor mitigation: 'Upgrade to Loofah >= 2.25.3'); the fix is carried in https://github.com/flavorjones/loofah/pull/324 and commit ad92002966053309f83b550861e2ef04bc714744, published as release https://github.com/flavorjones/loofah/releases/tag/v2.25.3, with details in GHSA-jcff-cj73-4w4f. Plan the upgrade knowing that 2.25.3 raises the gem's requirements to Ruby >= 3.2 and Nokogiri >= 1.19.5 (the Nokogiri floor comes from a separate attribute-escaping fix), so deployments still on Ruby 3.1 or earlier cannot simply bump the gem and must either upgrade the Ruby runtime or accept staying on 2.25.2 with compensating controls. If an immediate upgrade is not possible, stop passing HTML-encoded user-controlled strings into Loofah::HTML5::Scrub.allowed_uri? or Rails::HTML::Sanitizer.allowed_uri? - note the helper is only unsafe in that direct, string-level use, and applications relying solely on Loofah's default sanitize() path are not exposed, so routing URL approval through full-document sanitization rather than the standalone helper removes the bypass, at the cost of reworking any custom validation code. Additional data: URI rejection at the application layer would also block the demonstrated payload, but that duplicates logic the advisory intends to be fixed in the library and should be treated as temporary.

Affected VersionsENISA

loofah = 2.25.2

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 scrubbing library built on Nokogiri, and Rails::HTML::Sanitizer re-exports its allowed_uri? helper. The root cause is a normalization mismatch in a safelist check (CWE-79, with the advisory also classifying it as CWE-184, incomplete list of disallowed inputs): allowed_uri? normalizes input with CGI.unescapeHTML, which decodes numeric character references but not HTML5 named character references. A data: URI whose mediatype is written with &sol; in place of the solidus therefore still lacks a '/' after normalization, fails the MIME type grammar, and falls back to the allowed text/plain under the WHATWG rule for a malformed mediatype - while the browser decodes &sol; and reads the same value as text/html. Per the advisory, &colon;, &sol;, &Tab; and &NewLine; are the only named references in the HTML5 table that decode to characters changing how a URI parses (U+003A, U+002F, U+0009, U+000A), which is why the patch closes exactly that set. The upstream PR (324) also reorders normalization so character references are decoded before anything is stripped, adds handling for these named references, and adjusts the safelist entries for SVG textPath/mpath plus CSS url parsing. The default Loofah sanitize() path is unaffected because Nokogiri decodes the entity during parsing before Loofah evaluates the URI; exposure is limited to callers of the public string-level helper that pass it HTML-encoded strings. Per the CVSS 4.0 vector supplied (PR:N, UI:P), exploitation is unauthenticated but requires victim interaction with the rendered attribute. The trigger is not otherwise described in the available sources.

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

Network-reachable unauthenticated sanitizer bypass needing victim interaction (UI:R) and crossing into the browser context (S:C) with limited script-level C/I impact and no availability effect.

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
Red Hat 6.1 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

DescriptionCVE.org

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. In 2.25.2, Loofah::HTML5::Scrub.allowed_uri? treats a data URI mediatype containing the HTML5 named solidus reference &sol; as malformed and falls back to the allowed text/plain, while a browser decodes the reference and interprets the same value as text/html. An application that validates a user-controlled URL with this helper and renders the approved value in href or another browser-interpreted URI attribute can allow cross-site scripting. Rails::HTML::Sanitizer.allowed_uri? re-exports the affected helper. Loofah's default sanitize() path is not affected because Nokogiri decodes the entity before URI validation. This issue is fixed in version 2.25.3.

Threat Intelligence Overview

EPSS Score
0.4%
Top 64% exploitable
Prevalence
High
Core HTML sanitization gem widely used across Ruby/Rails applications
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
2
Sightings
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub

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 Yes
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
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
High
Technical Impact
Partial

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: +20
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 Loofah

View all
CVE-2022-23518 MEDIUM POC
6.1 Dec 14

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Rated medium severity (CVSS 6.1

CVE-2022-23516 HIGH
7.5 Dec 14

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri

CVE-2022-23514 HIGH
7.5 Dec 14

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri

CVE-2026-126203 MEDIUM
6.1 Nov 12

Mutation XSS in Loofah's HTML5 sanitization path (versions 2.21.0 through 2.25.2, running on Nokogiri before 1.19.5) let

CVE-2022-23515 MEDIUM
6.1 Dec 14

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri

CVE-2018-8048 MEDIUM
6.1 Mar 27

In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in sanitized output by republishing

CVE-2019-15587 MEDIUM
5.4 Oct 22

In the Loofah gem for Ruby through v2.3.0 unsanitized JavaScript may occur in sanitized output when a crafted SVG elemen

CVE-2018-16468 MEDIUM
5.4 Oct 30

In the Loofah gem for Ruby, through v2.2.2, unsanitized JavaScript may occur in sanitized output when a crafted SVG elem

CVE-2026-126205 MEDIUM
5.3 Nov 12

Quadratic-time regular-expression processing in Loofah's SVG local-reference check allows attacker-supplied HTML to cons

CVE-2026-126207 MEDIUM
4.7 Nov 12

Loofah versions before 2.25.3 can emit a live CSS url() from a sanitized style attribute, causing a viewer's browser to

CVE-2026-73490 MEDIUM
4.7 Aug 12

SVG href attribute bypass in Loofah prior to 2.25.2 allows a crafted sanitized SVG to reference arbitrary same-origin ex

CVE-2026-73492 LOW
2.3 Aug 12

Cross-site scripting in Loofah 2.25.0-2.25.1 is possible when applications call `Loofah::HTML5::Scrub.allowed_uri?` dire

Vendor StatusVendor

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