CVE-2022-29181 Improper Handling of Unexpected Data Type in Nokogiri
Attackers can cause crashes or read unrelated memory in Nokogiri by providing untrusted inputs to SAX parsers without proper type checking.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-29181?
CVE-2022-29181 is a high-severity memory corruption vulnerability in Apple Macos, published on 20 May 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
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.
Which versions are affected by CVE-2022-29181?
2 open source packages ship an affected version, including nokogiri. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
nokogiri RubyGems | All versions | 1.13.6 |
nokogiri RubyGems | All versions | 1.13.6 |
Products include Apple Macos, Nokogiri Nokogiri.
How do I fix CVE-2022-29181?
Upgrade nokogiri to 1.13.6 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2022-29181 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-29181 exists.
Other vulnerabilities in Apple Macos
Sources
Also known as DEBIAN-CVE-2022-29181, GHSA-xh29-r2w5-wx8m, MGASA-2022-0200, UBUNTU-CVE-2022-29181.