CVE-2026-61847: Crass: A large number of adjacent CSS comments can trigger a SystemStackError

Published Oct 29, 2026
·
Updated

Impact

When the :preservecomments 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 :preservecomments option to true if this is acceptable to your use case (recursion doesn't occur when comments are preserved).

Affected Software

1 affected componentFixes available
rubygems/crass<1.0.7
1.0.7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/crass to a version that resolves this vulnerability.

    Fixed in 1.0.7
  2. Upgrade

    Upgrade Crass to a version that resolves this vulnerability.

    Fixed in 1.0.7
  3. Configuration

    Set the :preserve_comments option to true if preserving CSS comments is acceptable for the use case.

    Crass :preserve_comments = true

Event History

Oct 29, 2026
Advisory Published
via GitHub·04:35 PM
Data Sourced
via GitHub·04:35 PM
DescriptionWeaknessAffected Software
Data Sourced
via OSV·04:35 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Who is exposed to this issue?

Applications that parse attacker-controlled CSS with Crass are exposed when comment preservation is disabled. This is the default behavior because the :preserve_comments option is not enabled by default.

2

What does an attacker need to provide?

An attacker needs to supply a stylesheet containing a very large number of adjacent CSS comments. No authentication or user interaction is required according to the supplied severity vector.

3

What can be done if upgrading is not immediately possible?

Set the :preserve_comments option to true, if preserving comments is acceptable for the application. With comments preserved, the recursive comment-discarding behavior does not occur.

4

Which version fixes the problem?

Crass 1.0.7 fixes the issue by no longer using recursion when discarding comments.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203