CVE-2026-126207: Loofah: CSS url() sanitization bypass via escaped parentheses
Published 2026-11-12 · Updated 2026-11-12 · Also known as GHSA-m3x9-938q-5767
Summary
Loofah's CSS sanitization logic fails to correctly identify escaped characters within CSS url() functions, allowing bypassed payloads in style attributes. Applications using Loofah to sanitize user-supplied HTML must upgrade to version 2.25.3 or later to secure rendered content.
Who is affected
Affected deployments are those that sanitize user-supplied HTML and render it to other users. By exploiting the bypass, an attacker can force a viewer's browser to send requests to arbitrary URLs upon rendering or hovering over malicious style attributes. This can result in the exposure of a viewer's IP address, user agent, and access timing, or permit requests to internally routable hosts.
Exploitability
The vulnerability is exploitable via a network vector with low attack complexity, requiring user interaction to execute. With an EPSS score of 0.003 and no listing on the CISA KEV catalog, there is currently no evidence of active exploitation in the wild.
Remediation
- Upgrade the RubyGems loofah package to version 2.25.3 or later.
- Verify the updated dependency version in your project's Gemfile.lock.
How to check your project
- Check the Gemfile.lock file for 'loofah' and confirm if the installed version is less than 2.25.3.
- Run 'bundle outdated loofah' to identify if a vulnerable version is present in your environment.
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| RubyGems | loofah |
>= 0, < 2.25.3 | 2.25.3 | bundle update loofah |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | Required |
| Scope | Changed |
| Confidentiality | Low |
| Integrity | None |
| Availability | None |
FAQ
What specifically allows this bypass?
The flaw exists because CSS escapes, such as those used for parentheses in url() functions, are decoded during property rebuilding, causing the sanitization logic to miss the malicious tokens after the initial parsing check.
Does this vulnerability allow for XSS?
No, the vulnerability description explicitly states that no script survives the sanitization process.
Is there a known exploit for this?
Not documented; while the mechanism is described, no specific exploit code or active exploitation instances (CISA KEV) have been reported.
Original advisory description
References
- WEB https://github.com/flavorjones/loofah/security/advisories/GHSA-m3x9-938q-5767
- WEB https://github.com/flavorjones/loofah/pull/324
- WEB https://github.com/flavorjones/loofah/commit/b198a36e44c9c5408163ac50787825e8ca0b166b
- PACKAGE https://github.com/flavorjones/loofah
- WEB https://github.com/flavorjones/loofah/releases/tag/v2.25.3
- WEB https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-m3x9-938q-5767.yml
Source records: GHSA-m3x9-938q-5767 (OSV.dev) · EPSS by FIRST, 2026-11-26.