CVE-2026-126205
Received Received - Intake

ReDoS in Loofah HTML5 Sanitizer via SVG href Attributes

Vulnerability report for CVE-2026-126205, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-11-12

Last updated on: 2026-11-12

Assigner: GitHub, Inc.

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-11-12
Last Modified
2026-11-12
Generated
2026-11-12
AI Q&A
2026-11-12
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
flavorjones loofah 2.25.3

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-1333 The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
CWE-400 The product does not properly control the allocation and maintenance of a limited resource.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a regular expression denial of service (ReDoS) in the Loofah library affecting versions prior to 2.25.3. It occurs when processing SVG elements with href or xlink:href attributes containing long whitespace strings. The regex pattern used causes quadratic time complexity, leading to excessive CPU consumption during sanitization.

Detection Guidance

To detect this vulnerability, check the installed version of Loofah using the command: gem list loofah. If the version is below 2.25.3, the system is vulnerable. Additionally, monitor CPU usage during SVG sanitization processes, as excessive CPU consumption may indicate exploitation.

Impact Analysis

An attacker could exploit this by submitting malicious SVG content to consume CPU resources quadratically, causing performance degradation or denial of service in applications using affected Loofah versions. Systems running CRuby 3.1 or earlier and JRuby are particularly vulnerable.

Mitigation Strategies

Upgrade Loofah to version 2.25.3 or later using the command: gem install loofah -v 2.25.3. If using CRuby 3.1 or earlier, upgrade to CRuby 3.2 or newer to benefit from linear-time regex matching.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-126205. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart

Security Radar

News mentioning this vulnerability
Loading related security news...