CVE-2022-29181 json
Improper Handling of Unexpected Data Type in Nokogiri
published 2022-05-20 4 y ago modified 2026-06-17 4 mo ago also GHSA-xh29-r2w5-wx8m , EUVD-2022-5789
- cvss
- 8.2
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 3.2%
- EPSS 3.2% chance of exploitation in 30 days, percentile 88%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- rubygems nokogiri 1.13.6
- nokogiri nokogiri 1.13.6
- apple macos 13.1
- ruby-nokogiri Debian 14, Debian 13, Debian 12 1.13.7+dfsg-1
debian advisories DEBIAN-CVE-2022-29181
- ruby-nokogiri Ubuntu Pro 20.04 LTS 1.10.7+dfsg1-2ubuntu0.1~esm2
- ruby-nokogiri Ubuntu Pro 22.04 LTS 1.13.1+dfsg-2ubuntu0.1~esm1
ubuntu advisories UBUNTU-CVE-2022-29181
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- foreman satellite utils 6.12, satellite capsule 6.12, satellite 6.12 3.3.0.17-1.el8sat
- candlepin satellite 6.12 4.1.15-1.el8sat
- foreman-cli satellite utils 6.12, satellite 6.12 3.3.0.17-1.el8sat
- foreman-ec2 satellite 6.12 3.3.0.17-1.el8sat
- foreman-gce satellite 6.12 3.3.0.17-1.el8sat
- rubygem-git satellite 6.12 1.11.0-1.el8sat
- foreman-ovirt satellite 6.12 3.3.0.17-1.el8sat
- python-django satellite capsule 6.12, satellite 6.12 3.2.14-2.el8pc
red hat advisories RHSA-2022:8506
- rubygem-nokogiri SLE Module for Basesystem 15 SP4, openSUSE Leap 15.4 1.8.5-150400.14.3.1
- rubygem-nokogiri SLE Module for Basesystem 15 SP3, SLE High Availability Extension 15 SP2, SLE High Availability Extension 15 SP1 +2 more 1.8.5-150000.3.9.1
- rubygem-nokogiri OpenStack Cloud Crowbar 9, OpenStack Cloud Crowbar 8 1.6.1-5.6.1
suse advisories SUSE-SU-2022:4016-1SUSE-SU-2022:4015-1SUSE-SU-2022:3890-1
- rubygem-nokogiri openSUSE Tumbleweed 1.18.9-1.4
- rubygem-nokogiri openSUSE Tumbleweed 1.18.2-1.1
- rubygem-nokogiri openSUSE Tumbleweed 1.15.5-1.5
- rubygem-nokogiri openSUSE Tumbleweed 1.13.6-1.1
- ruby3.2-rubygem-nokogiri openSUSE Tumbleweed 1.13.9-1.7
opensuse advisories openSUSE-SU-2026:10356-1openSUSE-SU-2025:14697-1openSUSE-SU-2024:14174-1openSUSE-SU-2024:12085-1openSUSE-SU-2024:13165-1
- ruby-nokogiri Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 1.13.6-r0
alpine advisories ALPINE-CVE-2022-29181
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-29181 updated cvss 8.2
rubygem-nokogiri: Improper Handling of Unexpected Data Type in Nokogiri
-
Red Hat CloudForms Management Engine 5 rubygem-nokogiriaffected: workaround, no fix planned “To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #to_s or equivalent.”
-
Red Hat Satellite 6.12 for RHEL 8 rubygem-nokogiri 1.13.8-1.el8satfixed: vendor fix “To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #to_s or equivalent.” RHSA-2022:8506
-
Red Hat Satellite 6.12 for RHEL 8 cjson 1.7.14-5.el8sat, libdb 5.3.28-42.el8_4, katello 4.5.0-1.el8sat, libsolv 0.7.22-4.el8pc, libcomps 0.1.18-4.el8pc, python-idna 3.3-2.el8pc, +640 morenot affected: vulnerable code not present “To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #to_s or equivalent.”
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- yes
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
3.23% chance of exploitation in the next 30 days, higher than 88% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- securitylab.github.com https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.2 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
| NVD | 3.1 | 8.2 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
| NVD | 2.0 | 6.4 | AV:N/AC:L/Au:N/C:P/I:N/A:P |
| GitHub | 3.1 | 8.2 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | nokogiri | <1.13.6 |
1.13.6 |
Affected products
- sparklemotion nokogiri
Classification
References
-
github.com
/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7
web
-
github.com
/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267
web, patch, third-party-advisory
-
securitylab.github.com
/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/
exploit, third-party-advisory
-
security.gentoo.org
/glsa/202208-29
vendor-advisory, web, third-party-advisory
-
github.com
/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m
web, issue-tracking, third-party-advisory
-
github.com
/sparklemotion/nokogiri/releases/tag/v1.13.6
web, release-notes, third-party-advisory
-
securitylab.github.com
/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri
advisory
-
support.apple.com
/kb/HT213532
web, third-party-advisory
-
seclists.org
/fulldisclosure/2022/Dec/23
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-29181
advisory
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-29181.yml
web
-
github.com
/sparklemotion/nokogiri
package
Sources
- CVE List CVE-2022-29181
- GitHub Advisory GHSA-xh29-r2w5-wx8m
- NVD CVE-2022-29181
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.