CVE-2022-29181
rubygem-nokogiri: Improper Handling of Unexpected Data Type in Nokogiri
Overview
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.
Source: OX vulnerability database
Severity
8.2 · HIGH
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Weakness: CWE-241, CWE-843
Affected packages · 1
| Ecosystem | Package | Vulnerable | Fixed in |
|---|---|---|---|
| RubyGems | nokogiri | <1.13.6 | 1.13.6 |
Open a package to see all its vulnerabilities.
Operating systems · 20 fixes
Photon OS 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 4.0 | rubygem-nokogiri | 1.13.6-1.ph4 |
Red Hat 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 7 | rubygem-nokogiri +1 | wont fix |
| 8 | rubygem-nokogiri +1 | wont fix |
SUSE Linux Enterprise 1 release · 1 package
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.4 | ruby2-5-rubygem-nokogiri | 1.8.5-150400.14.3.1 | SUSE-SU-2022:4016-1 |
alpine 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.22 | ruby-nokogiri | 1.13.6-r0 |
| 3.23 | ruby-nokogiri | 1.13.6-r0 |
| 3.24 | ruby-nokogiri | 1.13.6-r0 |
| edge | ruby-nokogiri | 1.13.6-r0 |
debian 4 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | ruby-nokogiri | affected |
| 12 | ruby-nokogiri | 1.13.7+dfsg-1 |
| 13 | ruby-nokogiri | 1.13.7+dfsg-1 |
| 14 | ruby-nokogiri | 1.13.7+dfsg-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| ruby-nokogiri | 1.13.7+dfsg-1 |
openSUSE 1 release · 5 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Tumbleweed | ruby3-1-rubygem-nokogiri | 1.13.6-1.1 | openSUSE-SU-2024:12085-1 |
| Tumbleweed | ruby3-2-rubygem-nokogiri | 1.13.9-1.7 | openSUSE-SU-2024:13165-1 |
| Tumbleweed | ruby3-3-rubygem-nokogiri | 1.15.5-1.5 | openSUSE-SU-2024:14174-1 |
| Tumbleweed | ruby3-4-rubygem-nokogiri | 1.18.2-1.1 | openSUSE-SU-2025:14697-1 |
| Tumbleweed | ruby4-0-rubygem-nokogiri | 1.18.9-1.4 | openSUSE-SU-2026:10356-1 |
ubuntu 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 20.04-ESM | ruby-nokogiri | 1.10.7+dfsg1-2ubuntu0.1~esm2 |
| 22.04 | ruby-nokogiri | affected |
References
- seclists.org http://seclists.org/fulldisclosure/2022/Dec/23
- access.redhat.com https://access.redhat.com/security/cve/CVE-2022-29181
- github.com https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-29181.yml
- github.com https://github.com/sparklemotion/nokogiri
- github.com https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7
- github.com https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7 (v1.13.6)
- github.com https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267
- github.com https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.6
- github.com https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2022-29181
Show all 16 references
- security.gentoo.org https://security.gentoo.org/glsa/202208-29
- securitylab.github.com https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri
- securitylab.github.com https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/
- support.apple.com https://support.apple.com/kb/HT213532
- ubuntu.com https://ubuntu.com/security/notices/USN-7659-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2022-29181
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.