Inefficient Regular Expression Complexity in Nokogiri
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-1333.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| sparklemotion | nokogiri | before 1.13.4 | 1.13.4 | Patch available | CNA |
| — | nokogiri (RubyGems) | before 1.13.4 | 1.13.4 | Patch available | GHSA-crjr-9rc5-ghw8 |
- nokogiri Vendorsparklemotion Affected before 1.13.4 Fixed in 1.13.4 Patch available CNA
- nokogiri (RubyGems) Vendor— Affected before 1.13.4 Fixed in 1.13.4 Patch available GHSA-crjr-9rc5-ghw8
CPE configurations NVD · 7
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:* | before 1.13.4 | Vulnerable | sparklemotion |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* | 35 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* | 36 | Vulnerable | Fedoraproject |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* | 13.0 to before 13.1 | Vulnerable | Apple |
- cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:* Versions before 1.13.4 Vulnerable ·sparklemotion
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:* Versions 35 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:36:*:*:*:*:*:*:* Versions 36 Vulnerable ·Fedoraproject
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:* Versions 13.0 to before 13.1 Vulnerable ·Apple
Remediation
- Fix · CNA nokogiri (sparklemotion) Fixed in 1.13.4
- Fix · GHSA-crjr-9rc5-ghw8 nokogiri (RubyGems) Fixed in 1.13.4 Advisory →
Red Hat 1 advisory
- RHSA-2022:8506 Released 2022-11-16 · Red Hat rating ImportantSatellite 6.12 Release
- Red Hat Satellite 6.12 for RHEL 8 candlepin-4.1.15-1.el8sat, candlepin-selinux-4.1.15-1.el8sat, foreman-3.3.0.17-1.el8sat +19
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| CloudForms Management Engine 5 | Affected | No fix planned: Will not fix |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6.12 for RHEL 8 | Fixed | RHSA-2022:8506 |
Not affected: 1 product
- Red Hat Satellite 6.12 for RHEL 8
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24836
- 2026-10-03 Alias added: GHSA-crjr-9rc5-ghw8
References
Advisory 10
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-crjr-9rc5-ghw8
- FEDORA-2022-9ed7641ce0
- FEDORA-2022-132c6d7c2e
- FEDORA-2022-d231cb5e1f
- [debian-lts-announce] 20220513 [SECURITY] [DLA 3003-1] ruby-nokogiri security update
- GLSA-202208-29
- [debian-lts-announce] 20221012 [SECURITY] [DLA 3149-1] ruby-nokogiri security update
- https://support.apple.com/kb/HT213532
- 20221220 APPLE-SA-2022-12-13-4 macOS Ventura 13.1
- https://nvd.nist.gov/vuln/detail/CVE-2022-24836
Other 7
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-24836.yml
- https://github.com/sparklemotion/nokogiri
- https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.4
- https://groups.google.com/g/ruby-security-ann/c/vX7qSjsvWis/m/TJWN4oOKBwAJ?utm_medium=email&utm_source=footer
- https://lists.fedoraproject.org/archives/list/[email protected]/message/6DHCOWMA5PQTIQIMDENA7R2Y5BDYAIYM
- https://lists.fedoraproject.org/archives/list/[email protected]/message/OUPLBUZVM4WPFSXBEP2JS3R6LMKRTLFC
- https://lists.fedoraproject.org/archives/list/[email protected]/message/XMDCWRQXJQ3TFSETPCEFMQ6RR6ME5UA3
More sparklemotion Nokogiri vulnerabilities
- TI-2022-11724 Improper Handling of Unexpected Data Type in Nokogiri CVSS 3.1HIGH 8.2
- TI-2018-15259 zlib before 1.2.12 allows memory corruption when deflating (i.e., when compressing) if… CVSS 3.1HIGH 7.5
- TI-2019-03885 OS command injection in Nokogiri CVSS 3.1CRITICAL 9.8
- TI-2026-55247 Nokogiri before 1.19.3 ReDoS via CSS selector tokenizer CVSS 4.0HIGH 8.7
- TI-2022-07536 Unchecked return value from xmlTextReaderExpand in Nokogiri CVSS 3.1HIGH 7.5
- TI-2026-55248 Nokogiri before 1.19.3 Memory Leak via XSLT Transform CVSS 4.0MEDIUM 6.9
Sources
- CVE-2022-24836 · CVE Program
- CVE-2022-24836 · NVD
- FIRST EPSS
- GHSA-crjr-9rc5-ghw8 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-24836 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences