MEDIUM · CVSS 3.1 4.7 EPSS 0.4% · 24th percentile CWE-180CWE-184

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

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
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 vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionRequired
ScopeChanged
ConfidentialityLow
IntegrityNone
AvailabilityNone

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
## Summary `Loofah::HTML5::Scrub.scrub_css` rejected any property whose top-level Crass tokens included a `:url` or `:bad_url`, and left `url` out of the allowed CSS functions. Both checks ran only against the first parse of the `style` attribute. When `scrub_css` rebuilt each property it emitted identifiers with their CSS escapes decoded, so parentheses written as escapes - `url\28 …\29` - hid the `url` token from the checks, and the rebuilt value was re-parsed into a live `url()` that nothing checked again. An escaped property name, six-digit escapes, escaped comments and escaped quotes all reached the same place. ## Impact A sanitized `style` attribute could make a viewer's browser issue a request to an attacker-chosen URL. `list-style` fetches on render with no interaction, `cursor` on hover. That leaks the viewer's IP address, user agent and access timing, and can reach hosts routable only from the viewer's network. No script survives sanitization and the attacker cannot read the response, so the request itself is the whole impact. Applications that sanitize user-supplied HTML with Loofah's default allowlist and display it to other people are affected. ## Mitigation Upgrade to Loofah >= 2.25.3. ## Credit Reported by NotAFlightRisk through GitHub's private vulnerability reporting.

References

Source records: GHSA-m3x9-938q-5767 (OSV.dev) · EPSS by FIRST, 2026-11-26.