CVE-2026-116695 — Vulnerability in crass — CVE Details
Crass: Incorrect tokenization of bad URLs enables CSS sanitizer bypass
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.61%). Schedule for your next planned update.
Does your project use an affected crass version?
Paste your Gemfile.lock to check it for CVE-2026-116695 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
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.
Details
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.
Browsers terminate the bad URL at that ), so everything Crass treated as part of the bad URL is live CSS to a browser.
This bug has existed in every released version of Crass.
Impact
Crass by itself only mis-tokenizes input. The security impact is on CSS sanitizers that use Crass to make allow/deny decisions and then re-serialize the CSS. Exploitation requires a sanitizer that doesn't reject bad URL tokens wherever they occur. Confirmed examples (verified in Chromium against the sanitizers' output):
- Sanitize (all versions through 7.0.0):
- In
Sanitize::CSS.propertiesandstyleattributes, a bad URL inside a[...]or(...)block in the value of an allowlisted property can smuggle arbitrary declarations, such asposition: fixedor abackground-imageURL with a disallowed protocol. - In
Sanitize::CSS.stylesheetand<style>elements, a bad URL in a selector can smuggle arbitrary style rules and at-rules, including@import.
- In
- Loofah (
Loofah::HTML5::Scrub.scrub_css, used forstyleattributes), and therefore rails-html-sanitizer (sanitize_css, andsanitizewhenstyleis a permitted attribute): a bad URL inside an allowlisted function such ascalc()orrgb()can smuggle declarations Loofah normally strips, such asposition: fixedandurl()values.
Smuggled CSS can be used for UI redress (clickjacking or phishing overlays), loading attacker-controlled external resources, and, where rules or @import can be smuggled, CSS-based data exfiltration. This vulnerability doesn't allow script execution in modern browsers.
Patches
Fixed in Crass 1.0.8. Users of Sanitize, Loofah, rails-html-sanitizer, or any other library that uses Crass to sanitize CSS should upgrade Crass to 1.0.8 or later.
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.
References
- CSS Syntax Module Level 3, "Consume the remnants of a bad url": https://drafts.csswg.org/css-syntax-3/#consume-remnants-of-bad-url
Advisory Timeline
- First published October 28, 2026 (29 days ago).
- Last revised October 28, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install crass -v 1.0.8
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| crass RubyGems · Affected: 0.0.1, 0.0.2, 0.1.0, 0.2.0 (+9 more) | 1.0.8 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-436
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 6.1 score means for each attack dimension.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
References
- https://github.com/rgrove/crass/security/advisories/GHSA-pq4g-8rxf-4g29WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-116695ADVISORY
- https://github.com/rgrove/crass/commit/689fc45c632fdf3803b2f4e844ffc9cca3b08f34WEB
- https://github.com/rgrove/crassPACKAGE
- https://github.com/rgrove/crass/releases/tag/v1.0.8WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/crass/GHSA-pq4g-8rxf-4g29.ymlWEB
Frequently Asked Questions
- What is CVE-2026-116695?
- Crass: Incorrect tokenization of bad URLs enables CSS sanitizer bypass. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.1/10).
- How do I check if my project is affected by CVE-2026-116695?
- CVE-2026-116695 affects crass. It has a 0.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-116695 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is a below-median EPSS score — only 43.7% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-61845HIGH
Crass : Large numeric exponents cause CPU and memory denial of service
- CVE-2026-128084MEDIUM
sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger
- CVE-2026-61846MEDIUM
Crass: Deeply nested CSS blocks and functions can trigger a SystemStackError or excessive memory usage
- CVE-2026-61848MEDIUM
Crass: Non-ASCII characters cause superlinear CPU consumption
- CVE-2026-115472MEDIUM
Doorkeeper: When using public clients, any client can revoke any access token
- CVE-2026-61847MEDIUM
Crass: A large number of adjacent CSS comments can trigger a SystemStackError