High severityNVD Advisory· Published May 20, 2022· Updated May 27, 2025
Improper Handling of Unexpected Data Type in Nokogiri
CVE-2022-29181
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
nokogiriRubyGems | < 1.13.6 | 1.13.6 |
Affected products
13- ghsa-coords12 versionspkg:gem/nokogiripkg:rpm/opensuse/ruby3.2-rubygem-nokogiri&distro=openSUSE%20Tumbleweedpkg:rpm/opensuse/rubygem-nokogiri&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/rubygem-nokogiri&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/rubygem-nokogiri&distro=openSUSE%20Tumbleweedpkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP1pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20Linux%20Enterprise%20High%20Availability%20Extension%2015%20SP2pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP3pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20OpenStack%20Cloud%20Crowbar%208pkg:rpm/suse/rubygem-nokogiri&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 1.13.6+ 11 more
- (no CPE)range: < 1.13.6
- (no CPE)range: < 1.13.9-1.7
- (no CPE)range: < 1.8.5-150000.3.9.1
- (no CPE)range: < 1.8.5-150400.14.3.1
- (no CPE)range: < 1.13.6-1.1
- (no CPE)range: < 1.8.5-150000.3.9.1
- (no CPE)range: < 1.8.5-150000.3.9.1
- (no CPE)range: < 1.8.5-150000.3.9.1
- (no CPE)range: < 1.8.5-150000.3.9.1
- (no CPE)range: < 1.8.5-150400.14.3.1
- (no CPE)range: < 1.6.1-5.6.1
- (no CPE)range: < 1.6.1-5.6.1
- Range: < 1.13.6
Patches
Vulnerability mechanics
References
11- github.com/advisories/GHSA-xh29-r2w5-wx8mghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2022-29181ghsaADVISORY
- securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogirighsax_refsource_MISCADVISORY
- seclists.org/fulldisclosure/2022/Dec/23ghsaWEB
- github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-29181.ymlghsaWEB
- github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7ghsax_refsource_MISCWEB
- github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267ghsax_refsource_MISCWEB
- github.com/sparklemotion/nokogiri/releases/tag/v1.13.6ghsax_refsource_MISCWEB
- github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8mghsax_refsource_CONFIRMWEB
- security.gentoo.org/glsa/202208-29ghsaWEB
- support.apple.com/kb/HT213532ghsaWEB
News mentions
0No linked articles in our index yet.