Description
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#at_css, and Searchable#search to cause exponential regex backtracking and denial of service.
Published: 2026-08-25
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: Denial of Service via Regular Expression ReDoS in CSS selector tokenization
Action: Patch
AI Analysis

Impact

Nokogiri versions prior to 1.19.3 contain a regular expression denial of service vulnerability in the CSS selector tokenizer. The flaw lies in the string‑literal and identifier tokenization logic. When an attacker supplies crafted CSS selectors to methods such as Node#css, Node#at_css, or Searchable#search, the underlying regex engine can experience exponential backtracking, exhausting CPU or memory resources and causing a denial of service for the affected process. The vulnerability does not provide remote code execution or direct data exfiltration; its primary impact is availability disruption.

Affected Systems

The issue affects the Nokogiri library developed by sparklemotion. All installations of Nokogiri earlier than version 1.19.3 are vulnerable, regardless of host platform. Any Ruby application that uses Nokogiri to parse user‑supplied or untrusted CSS will be at risk. Updating to Nokogiri 1.19.3 or later removes the vulnerable tokenizer implementation.

Risk and Exploitability

The CVSS score of 8.7 reflects a high severity that can be exploited by remote or local attackers who can supply malicious CSS selectors to the vulnerable methods. The EPSS score is unavailable, and the vulnerability is not listed in CISA KEV, indicating no known widespread exploitation at this time. However, the nature of the flaw allows an attacker to trigger a denial of service through crafted input, and any application that accepts untrusted CSS without sanitization is a candidate for exploitation. The most likely attack vector is the inclusion of adversarial selectors in requests that reach Nokogiri’s CSS parsing APIs.

Generated by OpenCVE AI on August 25, 2026 at 17:02 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply an official patch by upgrading Nokogiri to version 1.19.3 or later.
  • Validate or sanitize any CSS selector strings before passing them to Nokogiri’s css, at_css, or search methods to prevent malformed inputs from triggering the tokenizer.
  • Limit the trusted source of CSS content or restrict the use of CSS selector parsing to safe, internal data.

Generated by OpenCVE AI on August 25, 2026 at 17:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-c4rq-3m3g-8wgx Nokogiri CSS selector tokenizer has regular expression backtracking
History

Tue, 01 Sep 2026 15:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*

Thu, 27 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Tue, 25 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 25 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Description 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#at_css, and Searchable#search to cause exponential regex backtracking and denial of service.
Title Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer
First Time appeared Nokogiri
Nokogiri nokogiri
Weaknesses CWE-1333
CPEs cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:*:*:*
Vendors & Products Nokogiri
Nokogiri nokogiri
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'}

cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Nokogiri Nokogiri
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-08-25T16:10:31.778Z

Reserved: 2026-08-25T14:29:43.528Z

Link: CVE-2026-79770

cve-icon Vulnrichment

Updated: 2026-08-25T16:10:28.512Z

cve-icon NVD

Status : Analyzed

Published: 2026-08-25T16:17:28.460

Modified: 2026-09-01T14:56:03.963

Link: CVE-2026-79770

cve-icon Redhat

Severity : Important

Publid Date: 2026-08-25T15:16:03Z

Links: CVE-2026-79770 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-25T17:15:05Z

Weaknesses
  • CWE-1333

    Inefficient Regular Expression Complexity