All vulnerabilities

RubyGems

CVE-2026-126207

Loofah: CSS url() sanitization bypass via escaped parentheses

Severity
Medium 4.7
Published
12 Nov 2026
Last changed
12 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.25.3
Exploit chance
0.3% in the next 30 daysHigher than 21% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-180Incomplete deny list (CWE-184)
Attack
Over the network · No login needed · Needs someone to click or open something
Attacker can
Read some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N
Also known as
GHSA-m3x9-938q-5767
Sources
OSV.dev and GitHub

Description

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.

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Upgrade to Loofah >= 2.25.3.

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
loofahRubyGems · osv:RubyGems:loofah
  • Every version before 2.25.3

About loofah

Total downloads (RubyGems)
780,664,962RubyGems, 24 Nov 2026

References