CVE-2026-61847 — crass
Fix: rgrove/crass@25d78ccCVE-2026-61847 is a CWE-674 vulnerability in crass. A fix is available for crass — see the affected versions and patch details below.
Crass: A large number of adjacent CSS comments can trigger a SystemStackError
Real-World Exposure
crassReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
Impact
When the :preserve_comments option is not enabled (which is the default behavior), Crass discards CSS comments by recursively consuming the next token. An attacker who provides a stylesheet containing a very large number of adjacent comments can cause excessive recursion and trigger a SystemStackError.
Patches
This is fixed in Crass 1.0.7, which no longer recurses when discarding comments.
Workarounds
Set the :preserve_comments option to true if this is acceptable to your use case (recursion doesn't occur when comments are preserved).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | crass | all versions | 1.0.7bundle update crass --conservative |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for crass, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update crass to 1.0.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-61847 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2026-61847 in your dependencies?
Find it across RubyGems, including transitive dependencies.