Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted SVG href to HTML sanitizer endpoint
-
DeliveryAttribute carries long multiline-whitespace value
-
ExploitRegex rescans value from each line start
-
ExecutionQuadratic CPU consumption exhausts worker
-
ImpactService 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Rated medium severity (CVSS 6.1
A sanitizer bypass in the Ruby gem Loofah 2.25.2 lets a crafted data: URI slip past Loofah::HTML5::Scrub.allowed_uri? (a
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
Mutation XSS in Loofah's HTML5 sanitization path (versions 2.21.0 through 2.25.2, running on Nokogiri before 1.19.5) let
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri
In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in sanitized output by republishing
In the Loofah gem for Ruby through v2.3.0 unsanitized JavaScript may occur in sanitized output when a crafted SVG elemen
In the Loofah gem for Ruby, through v2.2.2, unsanitized JavaScript may occur in sanitized output when a crafted SVG elem
Loofah versions before 2.25.3 can emit a live CSS url() from a sanitized style attribute, causing a viewer's browser to
SVG href attribute bypass in Loofah prior to 2.25.2 allows a crafted sanitized SVG to reference arbitrary same-origin ex
Cross-site scripting in Loofah 2.25.0-2.25.1 is possible when applications call `Loofah::HTML5::Scrub.allowed_uri?` dire
EUVD-2026-124678
GHSA-mf2j-8f84-cc9q
NVD
CVE.org
EPSS
Exploit-DB