All vulnerabilities

RubyGems

CVE-2026-116695

Crass: Incorrect tokenization of bad URLs enables CSS sanitizer bypass

Severity
Medium
Published
28 Oct 2026
Last changed
28 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
1.0.8
Exploit chance
0.4% in the next 30 daysHigher than 29% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
CWE-436
Also known as
GHSA-pq4g-8rxf-4g29
Sources
OSV.dev and GitHub

Description

Crass's tokenizer didn't terminate a bad URL token at a ) that followed an escaped backslash (\). As a result, Crass consumed more input as part of the bad URL than a spec-compliant browser does. CSS sanitizers that parse untrusted CSS with Crass and re-emit it could be tricked into passing through declarations, style rules, or at-rules (including @import) that the sanitizer would otherwise have removed, but that a browser would then parse and apply.

While consuming the remnants of a bad URL (CSS Syntax Level 3, §4.3.15), Crass checked whether the previously consumed code point and the next code point formed a valid escape, in addition to checking the next two unconsumed code points. After an escaped backslash, the previously consumed code point is a backslash, so a following ) was incorrectly treated as escaped and the bad URL token continued until the next unescaped ) or the end of the input.

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

Workarounds

There are no practical workarounds other than upgrading. Rejecting any CSS input that contains the character sequence \ would block the known trigger, but this is a blunt measure and may reject legitimate CSS.

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

Affected software

SoftwareAffected versions
crassRubyGems · osv:RubyGems:crass
  • Every version before 1.0.8

About crass

Total downloads (RubyGems)
649,854,345RubyGems, 23 Nov 2026

References