CVE-2022-29181 | Improper Handling of Unexpected Data Type in Nokogiri

Exp

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.

Published: 2022-05-20 Last update: 2025-05-27 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-29181 is rated High Exploit Risk (78.7/100): CVSS High severity, with medium exploitation likelihood (EPSS 4.18%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2022-29181

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2022-29181

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-04-07 4.29% 4.18% -0.11%
2 2026-03-25 3.58% 4.29% +0.71%
3 2026-03-21 3.58%

Full EPSS history (37 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-29181

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.2 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 4.2 [email protected]
8.2 3.1 HIGH
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:L)
Some sensitive info could get out, but not a total data dump.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 4.2 [email protected]
6.4 2.0 MEDIUM
AV:N/AC:L/Au:N/C:P/I:N/A:P Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:L)
Exploitation conditions are straightforward and predictable.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:N)
No integrity impact.
Availability impact (A:P)
Partial availability impact.
10.0 4.9 [email protected]

Weakness enumeration for CVE-2022-29181

GitHub Security Advisory for CVE-2022-29181

GHSA-xh29-r2w5-wx8m · Severity: high · Ecosystem: rubygems — Nokogiri Improperly Handles Unexpected Data Type

OS Trackers for CVE-2022-29181

vendor priority summary link
alpine CVE-2022-29181: 1 source package rows (ruby-nokogiri); 13 state rows across 7 repos (3.17-community, 3.18-community, 3.19-community, 3.20-community, 3.21-community, 3.22-community, edge-community); fixed 7, open 6. https://security.alpinelinux.org/vuln/CVE-2022-29181
debian unimportant CVE-2022-29181 unimportant priority: Debian including 1 source packages (ruby-nokogiri), 5 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 4, open 1. https://security-tracker.debian.org/tracker/CVE-2022-29181
gentoo low CVE-2022-29181: 1 GLSA(s) (202208-29), 1 atom(s) (dev-ruby/nokogiri); latest impact low. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-29181
redhat high https://access.redhat.com/security/cve/CVE-2022-29181
suse high https://www.suse.com/security/cve/CVE-2022-29181/
ubuntu medium CVE-2022-29181 medium priority: Ubuntu including 1 source packages (ruby-nokogiri), 14 status rows across 14 suites (bionic, focal, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): not-affected 7, ignored 4, released 3. https://ubuntu.com/security/CVE-2022-29181

Affected software / configurations for CVE-2022-29181

Vendor Product Version Raw CPE
nokogiri nokogiri < 1.13.6 cpe:2.3:a:nokogiri:nokogiri:*:*:*:*:*:ruby:*:*
apple macos >= 13.0, < 13.1 cpe:2.3:o:apple:macos:*:*:*:*:*:*:*:*

References for CVE-2022-29181

URL Tags
https://github.com/sparklemotion/nokogiri/commit/83cc451c3f29df397caa890afc3b714eae6ab8f7
https://github.com/sparklemotion/nokogiri/commit/db05ba9a1bd4b90aa6c76742cf6102a7c7297267 Patch Third Party Advisory
https://github.com/sparklemotion/nokogiri/releases/tag/v1.13.6 Release Notes Third Party Advisory
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m Issue Tracking Third Party Advisory
https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri
http://seclists.org/fulldisclosure/2022/Dec/23 Mailing List Third Party Advisory
https://security.gentoo.org/glsa/202208-29 Third Party Advisory
https://securitylab.github.com/advisories/GHSL-2022-031_GHSL-2022-032_Nokogiri/ Exploit Third Party Advisory
https://support.apple.com/kb/HT213532 Third Party Advisory
cvelogic Threat Intelligence