NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · RubyGems

CVE-2026-61848: Crass: Non-ASCII characters cause superlinear CPU consumption

mediumCVSS 4.0 6.3GHSA-8vfg-2r28-hvhj

Crass, the Ruby CSS parser (RubyGems `crass`), parses input with many non-ASCII characters in superlinear time. An attacker who controls the CSS text can burn CPU and cause a denial of service. All versions before 1.0.7 are affected. Upgrade to 1.0.7.

Published Oct 29, 2026 · Analysis Oct 31, 2026

What an attacker can do

Crass tracks the position of each character while it tokenizes CSS. The advisory says this tracking is inefficient for multi-byte characters, so parse time grows faster than the input size when the input holds many non-ASCII characters. The advisory does not name the exact code path.

The attack needs no privileges and no user interaction. The attacker only has to get a large block of non-ASCII text into a Crass parse. This matters for services that run user-supplied CSS through Crass, for example HTML or CSS sanitizers and style processors that depend on it. A single request with a long non-ASCII string can tie up a worker process. Repeated requests can exhaust a worker pool.

The flaw affects availability only. The CVSS 4.0 vector rates confidentiality and integrity impact as none, and the weakness is CWE-400, uncontrolled resource consumption.

Who is affected

Every release of the crass gem below 1.0.7 is affected. You are exposed if your app parses untrusted CSS, directly or through a gem that depends on Crass. Check the installed version and see which gems pull it in:

bundle list | grep crass
bundle exec gem dependency crass --reverse-dependencies

crass

Ecosystem
RubyGems
Affected
< 1.0.7
Fixed in
1.0.7
Check
bundle info crass

How to fix it

Upgrade to Crass 1.0.7, the patched version:

bundle update crass

If another gem pins an older Crass, update that gem too. The only workaround the advisory gives is to avoid passing non-ASCII input to Crass. Capping the size of untrusted CSS before parsing is a reasonable extra limit, but the advisory does not list it.

How to tell if you were hit

The advisory lists no log line or file to look for. Look for symptoms: Ruby workers pinned at high CPU, request timeouts on endpoints that parse CSS, and unusually long request bodies full of non-ASCII text. Compare request size with parse time on those endpoints. Run bundle list | grep crass across your projects to find old copies.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Impact

When parsing an input containing non-ASCII characters, inefficiencies in how Crass tracks the positions of multi-byte characters result in superlinear parsing time. An attacker-controlled input consisting of many non-ASCII characters could cause excessive CPU consumption and potentially denial of service.

Patches

This is fixed in Crass 1.0.7.

Workarounds

Avoid passing non-ASCII input to Crass. Or cultivate patience.

Credited to hourianto, rgrove.

Questions

Is Crass 1.0.6 affected by CVE-2026-61848?

Yes. The advisory marks every version below 1.0.7 as vulnerable, so 1.0.6 and older need the upgrade.

Can this flaw leak data or run code?

No. The advisory describes only excessive CPU use leading to denial of service. The CVSS 4.0 vector shows no confidentiality or integrity impact.

Is CVE-2026-61848 exploited in the wild?

The sources do not say so. It is not in CISA's KEV catalog and the advisory reports no known exploitation.

Is there a workaround if I cannot upgrade?

The advisory's only workaround is to avoid passing non-ASCII input to Crass. Upgrading to 1.0.7 is the real fix.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More RubyGems vulnerabilities

All RubyGems entries