CVE-2022-29181
Improper Handling of Unexpected Data Type in Nokogiri
Reported by github_m · Published May 20, 2022
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| ruby-nokogiri | Alpine | 1.13.6-r0 |
| macos | apple | 13.1 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| sparklemotion | nokogiri | < 1.13.6 |
| alpine | ruby-nokogiri | 0 |
| sparklemotion | nokogiri | 0 |
| RubyGems | nokogiri | 0 |
Timeline
- May 20, 2022 CVE Published
- May 21, 2022 EPSS Score (30 in total, the first dated here)
- Mar 17, 2026 Security Advisory (4 in total, the first dated here)
- Jun 27, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-29181
vulnetix vdb fixes CVE-2022-29181
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-29181/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m x_refsource_CONFIRM
- https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7 x_refsource_MISC
- https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267 x_refsource_MISC
- https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.6 x_refsource_MISC
- https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2022-29181 advisory
- https://github.com/advisories/GHSA-xh29-r2w5-wx8m advisory
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/CVE-2022-29181.yml advisory
- https://github.com/sparklemotion/nokogiri url
- https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/ url
- GLSA-202208-29 vendor-advisory
- https://support.apple.com/kb/HT213532 url
- 20221220 APPLE-SA-2022-12-13-4 macOS Ventura 13.1 mailing-list