CVE-2026-79770: Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer

Published May 6, 2026
·
Updated

Summary

Nokogiri's CSS selector tokenizer contains regular expressions whose construction may result in exponential regex backtracking on adversarial selectors. Three ReDoS vectors are addressed in this release:

1. String-literal tokenization on certain unterminated quoted-string input. 2. String-literal tokenization on a separate class of hex-escape-rich input. 3. Identifier tokenization on hex-escape-rich input.

The public CSS selector methods that funnel through the affected tokenizer are Nokogiri::CSS.xpathfor, Node#css, Node#atcss, Searchable#search, and CSS::Parser#parse.

Mitigation

Upgrade to Nokogiri >= 1.19.3.

If users are unable to upgrade, two options are available:

- Avoid the use of attacker-controlled text in CSS selectors. Applications that only pass developer-authored selectors to Nokogiri are not directly exposed. - Set global Regexp.timeout (Ruby 3.2+, JRuby 9.4+) to bound parse time.

Severity

The Nokogiri maintainers have evaluated this as High Severity (CVSS 7.5, AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

An attacker able to inject user-supplied text into a CSS selector parse method can cause exponential backtracking, resulting in a potential denial of service.

Resources

- CWE-1333: Inefficient Regular Expression Complexity

Credit

Vector 1 was responsibly reported by @colby-swandale. Vectors 2 and 3 were discovered by @flavorjones during the response to the original report.

Other sources

Nokogiri versions before 1.19.3 contain regular expression denial of service vulnerabilities in the CSS selector tokenizer affecting string-literal and identifier tokenization. Attackers can inject adversarial CSS selectors into methods like Node#css, Node#atcss, and Searchable#search to cause exponential regex backtracking and denial of service.

— NVD

Affected Software

11 affected componentsFixes available
rubygems/nokogiri<1.19.3
Nokogiri Nokogiri Ruby<1.19.3
rubygems/nokogiri<1.19.3
1.19.3
debian/ruby-nokogiri<=1.13.10+dfsg-2, <=1.18.2+dfsg-1
1.19.3+dfsg-1
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*
ubuntu/ruby-nokogiri*

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 1.19.3
  2. Upgrade

    Upgrade debian/ruby-nokogiri to a version that resolves this vulnerability.

    Fixed in 1.19.3+dfsg-1
  3. Upgrade

    Upgrade nokogiri to a version that resolves this vulnerability.

    Fixed in 1.19.3
  4. Configuration

    Set the global Regexp.timeout to bound parsing time (Ruby 3.2+ or JRuby 9.4+).

    Regexp.timeout
  5. Compensating control

    Avoid passing attacker-controlled or user-supplied text to CSS selector parsing methods.

Event History

May 6, 2026
Advisory Published
via GitHub·06:24 PM
Data Sourced
via GitHub·06:24 PM
DescriptionSeverityWeaknessAffected Software
Aug 25, 2026
CVE Published
via MITRE·03:16 PM
Data Sourced
via MITRE·03:16 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·04:17 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·04:17 PM
DescriptionSeverityWeakness
Event
via NVD·04:17 PM
Sep 1, 2026
Data Sourced
via NVD·02:56 PM
Affected Software

Frequently Asked Questions

1

Which applications are realistically exposed to this issue?

Applications using Nokogiri before 1.19.3 are exposed when they pass attacker-controlled CSS selector strings to Node#css, Node#at_css, or Searchable#search. The impact is denial of service through excessive regular-expression backtracking.

2

Does exploitation require authentication or user interaction?

No. The supplied severity vector indicates network access, low attack complexity, no privileges required, and no user interaction.

3

What version resolves the vulnerability?

Upgrade Nokogiri to version 1.19.3 or later. The affected versions are those before 1.19.3.

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