---
id: "CVE-2026-116695"
kind: "vulnerability"
aliases: ["CVE-2026-116695"]
title: "Crass Ruby CSS parser: bad URL handling lets sanitizers keep live CSS"
severity: "medium"
cvss: 5.3
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["crass", "css-sanitizer", "package", "ruby"]
not_affected_if: ["no-untrusted-css", "trusted-stylesheets-only"]
published_at: "2026-10-27T21:18:05+00:00"
first_seen_at: "2026-10-27T21:29:21+00:00"
updated_at: "2026-10-27T21:30:21+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-116695", "first_seen_at": "2026-10-27T21:29:21+00:00"}]
---

# Crass Ruby CSS parser: bad URL handling lets sanitizers keep live CSS

Crass, a Ruby CSS parser, mishandles a closing parenthesis after an escaped backslash inside a bad URL token, so it keeps declarations, rules or at-rules that browsers would treat as live CSS. A sanitizer that uses Crass to reserialize untrusted CSS can let through UI redress, external resource loading or CSS-based data exfiltration, though script execution is not possible in modern browsers.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Crass version with `bundle exec gem list crass` or by reading `Gemfile.lock` for `crass`.
- Search the codebase for `Crass` and `Crass.parse` to find where untrusted CSS is sanitized and reserialized.

## Fix

- Upgrade the crass gem to `1.0.8` or later.
- If you sanitize untrusted CSS, also reject or strip bad URL tokens before reserializing the output.

## Timeline

- 2026-10-27T21:29:21+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-116695

## From the sources

Crass is a Ruby CSS parser that is compliant with the CSS Syntax Level 3 specification. Prior to 1.0.8, Crass incorrectly treats a closing parenthesis after an escaped backslash as escaped while consuming the remnants of a bad URL. Crass therefore keeps declarations, style rules, or at-rules inside a bad URL token even though a browser treats them as live CSS. A sanitizer that parses untrusted CSS with Crass and reserializes it without rejecting the bad URL can allow CSS used for UI redress, external resource loading, or CSS-based data exfiltration, but this issue does not enable script execution in modern browsers. This issue is fixed in version 1.0.8.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
