Loofah CSS url() sanitization bypass via escaped parentheses
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- Low · None · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
Loofah::HTML5::Scrub.scrub_css checks a style attribute only on its first parse, then rebuilds the CSS with identifier escapes decoded, so escaped parentheses, property names, comments or quotes can produce a live url() that never gets a second safety check. An attacker can use list-style to make a viewer's browser request an attacker-chosen URL when content renders, or cursor to trigger the request on hover, disclosing the viewer's IP address, user agent and access timing and reaching internal-network hosts. No script survives sanitization and the attacker cannot read the response. CVSS 3.1 base score: 4.7 (MEDIUM).
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
Description from the CNA
Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Prior to 2.25.3, Loofah::HTML5::Scrub.scrub_css checks only the first parse of a style attribute, then rebuilds CSS with identifier escapes decoded so escaped parentheses, property names, comments, or quotes can become a live url() without a second safety check. An attacker can use list-style to make a viewer's browser request an attacker-chosen URL when content renders, or cursor to make the request on hover. The request can disclose the viewer's IP address, user agent, access timing, and access to internal-network hosts, but no script survives sanitization and the attacker cannot read the response. This issue is fixed in version 2.25.3.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| flavorjones | loofah | before 2.25.3 | 2.25.3 | Patch available | CNA |
| — | loofah (RubyGems) | before 2.25.3 | 2.25.3 | Patch available | GHSA-m3x9-938q-5767 |
- loofah Vendorflavorjones Affected before 2.25.3 Fixed in 2.25.3 Patch available CNA
- loofah (RubyGems) Vendor— Affected before 2.25.3 Fixed in 2.25.3 Patch available GHSA-m3x9-938q-5767
Remediation
Upgrade Loofah to version 2.25.3, which fixes the issue. Affected versions are those before 2.25.3 in the RubyGems ecosystem.
Written with Claude Haiku 5.5 from the sources below · 2026-11-13
- Fix · CNA loofah (flavorjones) Fixed in 2.25.3
- Fix · GHSA-m3x9-938q-5767 loofah (RubyGems) Fixed in 2.25.3 Advisory →
Timeline
- 2026-11-12 Threatist record created from CVE-2026-126207
- 2026-11-12 Alias added: GHSA-m3x9-938q-5767
- 2026-11-12 Fix available: RubyGems/[email protected] · GHSA-m3x9-938q-5767
- 2026-11-12 CVSS score added · GHSA-m3x9-938q-5767
- 2026-11-12 Weakness changed · GHSA-m3x9-938q-5767
- 2026-11-12 6 new references · GHSA-m3x9-938q-5767
- 2026-11-13 CISA SSVC decision points changed
References
Other 6
- https://github.com/flavorjones/loofah/security/advisories/GHSA-m3x9-938q-5767
- https://github.com/flavorjones/loofah/pull/324
- https://github.com/flavorjones/loofah/commit/b198a36e44c9c5408163ac50787825e8ca0b166b
- https://github.com/flavorjones/loofah/releases/tag/v2.25.3
- https://github.com/flavorjones/loofah
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-m3x9-938q-5767.yml
More flavorjones vulnerabilities
- TI-2022-07573 Inefficient Regular Expression Complexity in Loofah CVSS 3.1HIGH 7.5
- TI-2022-07575 Uncontrolled Recursion in Loofah CVSS 3.1HIGH 7.5
- TI-2018-05825 In the Loofah gem through 2.2.0 for Ruby, non-whitelisted HTML attributes may occur in… CVSS 3.0MEDIUM 6.1
- TI-2026-91019 Cross-site scripting in Loofah URI validation via encoded data URIs CVSS 4.0MEDIUM 5.3
- TI-2026-91016 Regular expression denial of service in Loofah SVG local-reference check CVSS 3.1MEDIUM 5.3
- TI-2022-07577 Improper neutralization of data URIs allows XSS in rails-html-sanitizer CVSS 3.1MEDIUM 6.1
Sources
- CVE-2026-126207 · CVE Program
- CVE-2026-126207 · NVD
- FIRST EPSS
- GHSA-m3x9-938q-5767 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences