CVE-2022-29181: Improper Handling of Unexpected Data Type in Nokogiri
Vulnerability summary
CVE-2022-29181 is a high (CVSS 8.2) vulnerability in apple macos. EPSS estimates a 3.23% chance of exploitation in the next 30 days, higher than 88.2% of scored vulnerabilities. 1 public exploit is recorded.
Public exploit (GitHub, Date unknown)
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 10 · Related 9Timeline
- 20-05-2022PublishedVulnerability first disclosed.
- 27-05-2025Last modifiedVulnerability information updated.
Description
Nokogiri is an open source XML and HTML library for Ruby. Nokogiri prior to version 1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers, allowing specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory. Version 1.13.6 contains a patch for this issue. As a workaround, ensure the untrusted input is a `String` by calling `#to_s` or equivalent.
CVSS metrics
7 scores · 6 sources · 2 versions- OSV · UbuntuEcosystem advisory · calculated8.2HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- OSV · DebianEcosystem advisory · calculated8.2HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- OSV · RubygemsEcosystem advisory · calculated8.2HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- NVDNIST8.2HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- OSV · AlpineEcosystem advisory · calculated8.2HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
EPSS trend
Probability
3.23%
Chance of exploitation in the next 30 days
Percentile
88%
Versus all other CVEs
30-day change
No change 0.00 pp
From 3.23% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundGhsl 2022 031 Ghsl 2022 032 Nokogiri
Maturity: poc
Weaknesses
CWE · root cause- CWE-241Improper Handling of Unexpected Data TypeThe product does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).
- CWE-843Access of Resource Using Incompatible TypeThe product allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Alpine1 product
- ruby-nokogiri< 1.13.6-r0
Apple1 product
- macos≥ 13.0, < 13.1
Debian1 product
- ruby-nokogiri< 1.13.7+dfsg-1
Mageia1 product
- ruby-nokogiri< 1.11.7-1.1.mga8
Nokogiri1 product
- nokogiri< 1.13.6
RubyGems1 product
- nokogiri< 1.13.6
Sparklemotion1 product
- nokogiri< 1.13.6
Ubuntu1 product
- ruby-nokogiri< 1.10.7+dfsg1-2ubuntu0.1~esm2 | < 1.13.1+dfsg-2ubuntu0.1~esm1
8 vendors · 8 products
References
20 links- github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8mX Refsource CONFIRMAdvisoryREPORTWEBIssue TrackingThird Party Advisory
- github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7X Refsource MISCREPORTWEB
- github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267X Refsource MISCREPORTWEBPatchThird Party Advisory
- github.com/sparklemotion/nokogiri/releases/tag/v1.13.6X Refsource MISCREPORTWEBRelease NotesThird Party Advisory
- securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/X TransferredREPORTExploitThird Party Advisory