Skip to main content

Loofah EUVDEUVD-2026-124678

| CVE-2026-126205 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-11-12 GitHub_M GHSA-mf2j-8f84-cc9q
5.3
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted SVG href to HTML sanitizer endpoint
  2. Delivery
    Attribute carries long multiline-whitespace value
  3. Exploit
    Regex rescans value from each line start
  4. Execution
    Quadratic CPU consumption exhausts worker
  5. Impact
    Service availability degraded (DoS)

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

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 pass attacker-controlled HTML to Loofah's HTML5 sanitizer (SVG elements in SVG_ALLOW_LOCAL_HREF are allowed by the default safelist, so no configuration change is needed) AND that it run on CRuby 3.1 or earlier, or on JRuby. The decisive limiting factor is the Ruby regexp engine: CRuby 3.2 and later use linear-time matching and are NOT exploitable, which eliminates risk for modern CRuby deployments regardless of Loofah version. There is no authentication, user-interaction, or special-feature prerequisite beyond reaching the sanitizer with an SVG reference element whose href/xlink:href is a long multiline-whitespace string.

Impact

This is a moderate-severity, availability-only issue (CVSS 5.3, A:L; C:N/I:N) rather than a top-tier emergency. The CVSS vector AV:N/AC:L/PR:N/UI:N indicates a remote, unauthenticated, low-complexity trigger - any application that feeds attacker-supplied HTML to Loofah's HTML5 sanitizer is reachable through its default safelist, with no configuration change needed. However, the impact is bounded CPU exhaustion that scales quadratically (not exponentially) with input length, and exploitation is conditional on the Ruby runtime: only CRuby 3.1 and earlier and JRuby are affected, while CRuby 3.2+ already matches the regex in linear time and is not vulnerable. The vuln.today decision label is 'this_month' (not act_now/emergency), consistent with a real-but-not-urgent ReDoS. No EPSS score was provided in the input, so exploitation-probability cannot be quantified here; there is no CISA KEV listing and no public exploit code identified - the supplied GitHub references are the advisory, fix PR, fix commit, and release tag, i.e. remediation artifacts rather than weaponized exploit code. Net: prioritize for routine patching this month, with urgency raised for deployments known to run CRuby ≤3.1 or JRuby, and lowered where CRuby 3.2+ is already in use.

Exploit ScenarioDerived

An attacker submits HTML containing an SVG reference element (such as a use, textPath, or mpath element) whose href or xlink:href attribute is a long multi-line run of whitespace to any endpoint that sanitizes user-supplied HTML with Loofah. During sanitization the SVG local-href regex rescans the all-whitespace value from every line start, consuming CPU quadratically in the attribute's length and degrading or stalling the worker. No public exploit code was identified; the attack requires only that the target run CRuby 3.1 or earlier, or JRuby.

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

Quadratic-time regular-expression processing in Loofah's SVG local-reference check allows attacker-supplied HTML to consume CPU out of proportion to input size during sanitization, an availability-only denial of service rated CVSS 5.3 (C:N/I:N/A:L). Only Loofah gem versions before 2.25.3 running on CRuby 3.1 or earlier, or on JRuby, are affected - CRuby 3.2 and later use linear-time regexp matching and are not exploitable regardless of Loofah version. The default safelist reaches the vulnerable check without any configuration change, no public exploit was identified at time of analysis, and the vendor has released 2.25.3 as the fix.

RemediationAI

Vendor-released patch: upgrade Loofah to 2.25.3 or later, per the advisory at https://github.com/flavorjones/loofah/security/advisories/GHSA-mf2j-8f84-cc9q. Be aware that the 2.25.3 release also raises the gem's minimum Ruby to 3.2 and bundles several unrelated sanitizer fixes (GHSA-p9wj-w8xq-vjx6, GHSA-jcff-cj73-4w4f, GHSA-m3x9-938q-5767, GHSA-345x-3rq2-jfrm, GHSA-h6v6-rg66-fqj4), so applications pinned to older Ruby cannot adopt it as a drop-in. The vendor-stated mitigating condition for applications on CRuby that cannot upgrade is to run CRuby 3.2 or later, whose linear-time regexp matching neutralizes this specific pattern; JRuby deployments have no equivalent engine-level mitigation and should upgrade Loofah. No other workaround is specified in the available sources.

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

Loofah is a Ruby HTML/XML manipulation and sanitization library built on Nokogiri (CPE cpe:2.3:a:flavorjones:loofah:*:*:*:*:*:*:*:*). Its HTML5 sanitizer restricts the href and xlink:href attributes of SVG reference elements listed in SVG_ALLOW_LOCAL_HREF to same-document (local) references, testing the attribute value against the pattern /^\s*[^#\s].*/m. In Ruby the ^ anchor matches at every line start and \s matches newline characters, so an all-whitespace value causes the engine to rescan the value starting from each of its line starts, producing time quadratic in the value's length - the CWE-1333 inefficient regular-expression complexity case that underlies the CWE-400 uncontrolled resource consumption classification. The decisive variable is the regexp engine, not the Loofah version: CRuby 3.2 introduced linear-time regexp matching that makes this pattern linear, while CRuby 3.1 and earlier and JRuby's engine do not have that guarantee. Because the affected elements are in the default safelist, ordinary sanitizer calls reach the vulnerable code path with no opt-in, and an attacker only needs to submit HTML containing an SVG reference element with a long multiline-whitespace href or xlink:href. The trigger requires the application to pass attacker-controlled markup to the HTML5 sanitizer on an affected Ruby runtime; no authentication, user interaction, or non-default feature is required per the assessed vector (AV:N/AC:L/PR:N/UI:N).

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

Attacker-supplied HTML reaches the sanitizer remotely with no auth or interaction (AV:N/AC:L/PR:N/UI:N); only CPU/availability is affected (A:L, C:N/I:N) and quadratic cost yields limited rather than complete impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/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
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

1
Patch available
Nov 12, 2026 - 21:02 EUVD

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, the Loofah HTML5 sanitizer checks href and xlink:href on elements in SVG_ALLOW_LOCAL_HREF with a regular expression whose line anchor and newline-matching whitespace cause an all-whitespace value to be rescanned from every line start. An attacker can submit an SVG reference element with a long multiline-whitespace attribute and consume CPU quadratically during sanitization. CRuby 3.1 and earlier and JRuby are affected, while CRuby 3.2 and later uses linear-time regular-expression matching. The default safelist reaches the vulnerable check without a configuration change. This issue is fixed in version 2.25.3.

Threat Intelligence Overview

EPSS Score
0.4%
Top 65% exploitable
Prevalence
Medium
common Ruby/Rails HTML sanitization library, but Ruby-ecosystem-only footprint
Threat Intel
1
1 sources
Social Media
2
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
Yes
Human Impact· derived
Medium

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

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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

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