CVE-2026-126205: Loofah Denial of Service Vulnerability
MODERATECVE-2026-126205 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Loofah libraries in the RubyGems ecosystem. The issue involves regular expression denial of service in the svg local-reference check. Remediation is available by upgrading affected packages to version 2.25.3.
CVE-2026-126205 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-126205
To remediate this vulnerability, upgrade all affected Loofah dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade loofah to 2.25.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for loofah
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-126205, inspect your project dependencies for Loofah:
inspect dependencies for loofah
Analyze the terminal output to locate any version of Loofah in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.25.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Loofah, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-126205 Affected Loofah Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
loofah
|
RubyGems |
< 2.25.3
|
2.25.3
|
References
Frequently Asked Questions
What is CVE-2026-126205?
Which Loofah versions are affected?
What version fixes CVE-2026-126205?
Is loofah affected?
What is the CVSS score of CVE-2026-126205?
What CWE is associated with CVE-2026-126205?
How can I check RubyGems dependencies for CVE-2026-126205?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mf2j-8f84-cc9q",
"modified" : "2026-12-02T16:23:58Z",
"published" : "2026-11-12T21:00:42Z",
"aliases" : [ "CVE-2026-126205" ],
"summary" : "Loofah: Regular expression denial of service in the SVG local-reference check",
"details" : "## Summary\n\nLoofah's HTML5 sanitizer restricts the `href` and `xlink:href` attributes of SVG reference elements to local references. That check matched the attribute value against `/^\\s*[^#\\s].*/m`. In Ruby `^` anchors to every line start and `\\s` matches newlines, so an all-whitespace value made the engine rescan the value from each of its line starts, taking time quadratic in its length.\n\nCRuby 3.1 and earlier, and JRuby, are affected. CRuby 3.2 added linear-time regexp matching, which makes the pattern linear. JRuby's regexp engine does not.\n\n## Impact\n\nAn attacker who supplies HTML to be sanitized can consume CPU out of proportion to the input size, by sending an SVG reference element whose `href` or `xlink:href` is a long run of whitespace.\n\nThe default safelist allows the elements in `SVG_ALLOW_LOCAL_HREF`, so no configuration change is required.\n\n## Mitigation\n\nUpgrade to Loofah >= 2.25.3. Applications on CRuby that cannot upgrade should run CRuby 3.2 or later, which matches the pattern in linear time.\n\n## Credit\n\nReported by scyoon through the Rails HackerOne program.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "loofah"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.25.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/flavorjones/loofah/security/advisories/GHSA-mf2j-8f84-cc9q"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-126205"
}, {
"type" : "WEB",
"url" : "https://github.com/flavorjones/loofah/pull/324"
}, {
"type" : "WEB",
"url" : "https://github.com/flavorjones/loofah/commit/2f31e7fae36036c9882d3d0fae720e1014c57cd1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/flavorjones/loofah"
}, {
"type" : "WEB",
"url" : "https://github.com/flavorjones/loofah/releases/tag/v2.25.3"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-mf2j-8f84-cc9q.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-11-12T21:00:42Z",
"nvd_published_at" : "2026-11-12T21:17:21Z"
}
}