Loofah: Regular expression denial of service in the SVG local-reference check
CVE-2026-126205GHSA-mf2j-8f84-cc9qPublished 12 Nov 2026, 20:41 UTC
Real-world risk
2.6/ 10Low
Routine
PreliminaryFrom the CVSS vector only · confidence low
CVSS
5.3
scored by the vendor (CNA), CVSS 3.1
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
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.
Am I affected?
What to do
Update to a fixed version: 2.25.3.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| Attacker position | InternetAnyone on the Internet can reach a typical deployment | From the CVSS vector | 1.00 |
| Privileges needed | NoneNo account | From the CVSS vector | 1.00 |
| Victim interaction | NoneNothing | From the CVSS vector | 1.00 |
| Configuration | DefaultOut-of-the-box installs are vulnerable | From the CVSS vector | 1.00 |
| Reliability | ReliableDeterministic: injection, logic bug, path traversal | From the CVSS vector | 1.00 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.4% chance of exploitation in 30 days (percentile 37), as of 2026-12-05.
The arithmetic
- Prerequisites multiplied together1.000
- Threat T1: Nothing known0.850
- 10 × impact 0.3 × prerequisites 1 × threat 0.852.550
- Rounded to one decimal between 0.1 and 102.6
Exploitation and evidence timeline
- 12 Nov 2026 Published
- 2 Dec 2026 Risk 2.6 (cvss fallback)
Weakness
CWE-400, CWE-1333
References
- https://github.com/flavorjones/loofah/security/advisories/GHSA-mf2j-8f84-cc9qvendor-advisory
- https://github.com/flavorjones/loofah/pull/324misc
- https://github.com/flavorjones/loofah/commit/2f31e7fae36036c9882d3d0fae720e1014c57cd1misc
- https://github.com/flavorjones/loofah/releases/tag/v2.25.3misc
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-mf2j-8f84-cc9q.yml
- https://nvd.nist.gov/vuln/detail/CVE-2026-126205
- https://github.com/advisories/GHSA-mf2j-8f84-cc9q
- CVE-2026-126205 on CVE.org