Vulnerability GHSA-m3x9-938q-5767

Medium Risk
MEDIUM RISK
CVSS Score: 4.7
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
19 hours ago
November 12, 2026 at 09:05 PM UTC
Loofah: CSS url() sanitization bypass via escaped parentheses
0.2.0 - 0.4.7 and 1.0.0.beta.1 and 1.0.0 - 2.0.3 and 2.1.0.rc1 and 2.1.0.rc2 and 2.1.0 - 2.20.0 and 2.21.0.rc1 and 2.21.0 - 2.25.2
0.2.0 - 0.4.7 and 1.0.0.beta.1 and 1.0.0 - 2.0.3 and 2.1.0.rc1 and 2.1.0.rc2 and 2.1.0 - 2.20.0 and 2.21.0.rc1 and 2.21.0 - 2.25.2

Summary

Loofah: CSS url() sanitization bypass via escaped parentheses

Details

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.

Impacted packages

Timeline

Published
19 hours ago
November 12, 2026 at 09:05 PM UTC
Fixed (2.25.3)
11 days ago
November 02, 2026 at 05:00 AM UTC
Last Modified
19 hours ago
November 12, 2026 at 09:15 PM UTC