What’s Vulnerable › Vulnerabilities
CVE-2022-24836: Inefficient Regular Expression Complexity in Nokogiri
- Severity: high (CVSS 7.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 3.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-04-11 · updated 2026-06-17
- Weakness: CWE-400
Description
Nokogiri is an open source XML and HTML library for Ruby. Nokogiri `< v1.13.4` contains an inefficient regular expression that is susceptible to excessive backtracking when attempting to detect encoding in HTML documents. Users are advised to upgrade to Nokogiri `>= 1.13.4`. There are no known workarounds for this issue.
Affected products
- Apple macOS: from 13.0 before 13.1 — fixed in 13.1
- Debian Linux: 9.0, 10.0
- Fedoraproject Fedora: 34, 35, 36
- sparklemotion nokogiri: before 1.13.4 — fixed in 1.13.4
- Rubygems Nokogiri: before 1.13.4; 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5 (+137) — fixed in 1.13.4
How to fix
Upgrade to a fixed version: Apple macOS 13.1; sparklemotion nokogiri 1.13.4; Rubygems Nokogiri 1.13.4. Check the vendor advisory for mitigations.
References
- http://seclists.org/fulldisclosure/2022/Dec/23
- https://github.com/sparklemotion/nokogiri/commit/e444525ef1634b675cd1cf52d39f4320ef0aecfd
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-crjr-9rc5-ghw8
- https://lists.debian.org/debian-lts-announce/2022/05/msg00013.html
- https://lists.debian.org/debian-lts-announce/2022/10/msg00018.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6DHCOWMA5PQTIQIMDENA7R2Y5BDYAIYM/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OUPLBUZVM4WPFSXBEP2JS3R6LMKRTLFC/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XMDCWRQXJQ3TFSETPCEFMQ6RR6ME5UA3/
- https://security.gentoo.org/glsa/202208-29
- https://support.apple.com/kb/HT213532
- http://seclists.org/fulldisclosure/2022/Dec/23
- https://github.com/sparklemotion/nokogiri/commit/e444525ef1634b675cd1cf52d39f4320ef0aecfd
Get alerted when CVE-2022-24836 or the next vulnerability affects your stack