---
id: "CVE-2026-61846"
kind: "vulnerability"
aliases: ["CVE-2026-61846", "GHSA-6jxj-px6v-747w"]
title: "Crass: Deeply nested CSS blocks and functions can trigger a SystemStackError or excessive memory usage"
severity: "medium"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "crass", "fixed": ["1.0.7"], "affected": "< 1.0.7", "ecosystem": "rubygems"}]
ecosystems: ["rubygems"]
tags: ["crass", "cwe-400", "package", "ruby", "rubygems"]
not_affected_if: ["crass-not-used", "trusted-input-only"]
published_at: "2026-10-29T16:35:16+00:00"
first_seen_at: "2026-10-29T16:39:03+00:00"
updated_at: "2026-10-29T16:39:50+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-6jxj-px6v-747w", "first_seen_at": "2026-10-29T16:39:03+00:00"}]
---

# Crass: Deeply nested CSS blocks and functions can trigger a SystemStackError or excessive memory usage

Crass is a Ruby CSS parser that recurses through nested CSS blocks and functions without a depth limit. A crafted CSS value with many deep nestings can raise a stack overflow error or consume excessive memory, causing denial of service.

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

## Affected

- rubygems:crass affected < 1.0.7 fixed 1.0.7

## How to check

- Check the installed version with `gem list crass` or by inspecting the `Gemfile.lock` for `crass`.
- Look for any application code that passes attacker-controlled CSS strings into Crass.

## Fix

- Upgrade `crass` to `1.0.7` or later, which adds a configurable depth limit.

## Timeline

- 2026-10-29T16:39:03+00:00 ghsa https://github.com/advisories/GHSA-6jxj-px6v-747w

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/rgrove/crass/security-advisories/GHSA-6jxj-px6v-747w
- [advisory] Maintainer's advisory: github.com https://github.com/rgrove/crass/security/advisories/GHSA-6jxj-px6v-747w
- [fix] Patch: github.com https://github.com/rgrove/crass/commit/cf68287356ec6e20d51cfc4a2d0c3912b7334e99
- [fix] Release: github.com https://github.com/rgrove/crass/releases/tag/v1.0.7

## From the sources

### Impact

Crass recursively parses CSS simple blocks and functions without a depth guard. An attacker-controlled value containing many deeply nested blocks can recurse until Ruby raises `SystemStackError: stack level too deep`, or can cause excessive memory usage.

### Patches

This is fixed in Crass 1.0.7, which adds a configurable depth limit with a conservative default.

### Workarounds

Add `SystemStackError` handling around Crass calls in your application. Buy more RAM.

---

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