Vulnerability · Published May 20, 2022 · Assigned by GitHub_M

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

High 8.2

In plain English

A high-severity security flaw in nokogiri from sparklemotion. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 3.2% (higher than 88% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)8.2High
Exploit odds (30 days)3.2%top 11.7% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20ruby-nokogiri1.13.6-r0ALPINE-CVE-2022-29181
Alpine:v3.21ruby-nokogiri1.13.6-r0ALPINE-CVE-2022-29181
Alpine:v3.22ruby-nokogiri1.13.6-r0ALPINE-CVE-2022-29181
Alpine:v3.23ruby-nokogiri1.13.6-r0ALPINE-CVE-2022-29181
Alpine:v3.24ruby-nokogiri1.13.6-r0ALPINE-CVE-2022-29181
Debian:12ruby-nokogiri1.13.7+dfsg-1DEBIAN-CVE-2022-29181
Debian:13ruby-nokogiri1.13.7+dfsg-1DEBIAN-CVE-2022-29181
Debian:14ruby-nokogiri1.13.7+dfsg-1DEBIAN-CVE-2022-29181
RubyGemsnokogiri1.13.6GHSA-xh29-r2w5-wx8m

Affected products (as reported)

VendorProductVersions
sparklemotion nokogiri < 1.13.6

Weakness: CWE-241 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H

References