{"id":"CVE-2026-79770","aliases":["CVE-2026-79770","GHSA-c4rq-3m3g-8wgx"],"related":[],"kind":"vulnerability","state":"published","title":"Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nNokogiri'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:\n\n1. String-literal tokenization on certain unterminated quoted-string input.\n2. String-literal tokenization on a separate class of hex-escape-rich input.\n3. Identifier tokenization on hex-escape-rich input.\n\nThe public CSS selector methods that funnel through the affected tokenizer are `Nokogiri::CSS.xpath_for`, `Node#css`, `Node#at_css`, `Searchable#search`, and `CSS::Parser#parse`.\n\n\n## Mitigation\n\nUpgrade to Nokogiri `>= 1.19.3`.\n\nIf users are unable to upgrade, two options are available:\n\n- Avoid the use of attacker-controlled text in CSS selectors. Applications that only pass developer-authored selectors to Nokogiri are not directly exposed.\n- Set global `Regexp.timeout` (Ruby 3.2+, JRuby 9.4+) to bound parse time.\n\n## Severity\n\nThe 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`).\n\nAn attacker able to inject user-supplied text into a CSS selector parse method can cause exponential backtracking, resulting in a potential denial of service.\n\n\n## Resources\n\n- [CWE-1333: Inefficient Regular Expression Complexity](https://cwe.mitre.org/data/definitions/1333.html)\n\n\n## Credit\n\nVector 1 was responsibly reported by @colby-swandale. Vectors 2 and 3 were discovered by @flavorjones during the response to the original report.","format":"markdown","source":"ghsa"}],"published":"2026-05-06T18:24:18.000Z","modified":"2026-09-16T15:51:27.061Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":8.7,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.19.3","status":"affected"},{"type":"semver","version":"1.19.3","status":"unaffected"}],"vendor":"sparklemotion","product":"nokogiri","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.19.3"}],"ecosystem":"RubyGems","package":"nokogiri","purl":"pkg:gem/nokogiri","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.19.3"}],"vendor":"nokogiri","product":"nokogiri","cpe":"cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*","source":"nvd"}],"references":[{"url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-c4rq-3m3g-8wgx","tags":["mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/nokogiri-before-redos-via-css-selector-tokenizer","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-79770","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/sparklemotion/nokogiri","tags":["package"],"sources":["ghsa"]}],"credits":["colby-swandale","flavorjones"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-08-25T16:10:25.348Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-79770","url":"https://www.cve.org/CVERecord?id=CVE-2026-79770","licence":"CVE Terms of Use","modified":"2026-09-16T15:51:27.061Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c4rq-3m3g-8wgx","url":"https://github.com/advisories/GHSA-c4rq-3m3g-8wgx","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.628Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-79770","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-79770","licence":"Public domain","modified":"2026-09-01T14:56:03.963Z"}],"updatedAt":"2026-11-25T22:59:35.174Z","epss":{"score":0.00285,"percentile":0.22517,"date":"2026-12-02T12:00:21.000Z"}}