CVE-2022-29181: GHSL-2022-031_GHSL-2022-032: Type confusion in Nokogiri leads to memory leak or DoS - CVE-2022-29181

Published May 18, 2022
·
Updated

Summary

Nokogiri < v1.13.6 does not type-check all inputs into the XML and HTML4 SAX parsers. For CRuby users, this may allow specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory.

Severity

The Nokogiri maintainers have evaluated this as High 8.2 (CVSS3.1).

Mitigation

CRuby users should upgrade to Nokogiri >= 1.13.6.

JRuby users are not affected.

Workarounds

To avoid this vulnerability in affected applications, ensure the untrusted input is a String by calling #tos or equivalent.

Credit

This vulnerability was responsibly reported by @agustingianni and the Github Security Lab.

Other sources

Accounts. This issue was addressed with improved data protection.

Apple

AMD. A memory corruption issue was addressed with improved input validation.

Apple

AMD. An out-of-bounds write issue was addressed with improved input validation.

Apple

AppleMobileFileIntegrity. This issue was addressed by enabling hardened runtime.

Apple

Bluetooth. The issue was addressed with improved memory handling.

Apple

Credit

CVE-2022-24836, CVE-2022-29181, Mickey Jin@@patch1t, Tommy Muir@@Muirey03, John Aakerblom@@jaakerblom, Antonio Zekic@@antoniozekic, Weijia Dai@@dwj1210(Momo Security), Ian Beer(Google Project Zero), Felix Poulin-Belanger, pattern-f@@pattern_F_(Ant Security Light), Adam Doupé(ASU SEFCOM), Apple, Adam M., CVE-2022-46716, Mickey Jin@@patch1t(Offensive Security), Csaba Fitzl@@theevilbit(Offensive Security), Jiwon Park, Mieszko Wawrzyniak, an anonymous researcher, Ivan Fratric(Google Project Zero), KirtiKumar Anandrao Ramchandani, Michael (Biscuit) Thomas, Wojciech Reguła@@_r3ggi(SecuRing), @@real_as3617, Hyeon Park@@tree_segment(Team ApplePIE), Maddie Stone(Google Project Zero), ChengGang Wu(Institute of Computing Technology), Yan Kang(Institute of Computing Technology), YuHao Hu(Institute of Computing Technology), Yue Sun(Institute of Computing Technology), Jiming Wang(Institute of Computing Technology), (Institute of Computing Technology), JiKai Ren(Institute of Computing Technology), Hang Shu(Institute of Computing Technology), Chinese Academy(Sciences), KirtiKumar Anandrao Ramchandani (kirtikumarar.com), hazbinhotel(Trend Micro Zero Day Initiative), Samuel Groß(Google V8 Security), Dohyun Lee@@l33d0hyun(DNSLab at Korea University), Ryan Shin(IAAI SecLab at Korea University), Clément Lecigne(Google's Threat Analysis Group), Thijs Alkemade@@xnyhps(Computest Sector 7), CVE-2022-35252, Linus Henze(Pinauten GmbH), Yonghwi Jin@@jinmo123(Theori), John Balestrieri(Tinrocket), Mickey Jin@@patch1t(Trend Micro), Pan ZhenPeng@@Peterpan0927(STAR Labs SG Pte), ABC Research s.r.o.

Affected Software

4 affected componentsFixes available
Apple macOS Ventura<13.1
13.1
Nokogiri Nokogiri Ruby<1.13.6
Apple macOS>=13.0<13.1
rubygems/nokogiri<1.13.6
1.13.6

Event History

May 18, 2022
Advisory Published
via GitHub Security Lab·12:00 AM
Data Sourced
via GitHub Security Lab·12:00 AM
Description
May 20, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionSeverityWeakness
May 23, 2022
Advisory Published
via GitHub·11:15 PM

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-29181?

CVE-2022-29181 is a vulnerability in the Nokogiri library prior to version 1.13.6 that allows specially crafted inputs to cause illegal memory access errors or reads from unrelated memory.

2

What is the severity of CVE-2022-29181?

The severity of CVE-2022-29181 is high, with a severity score of 8.2.

3

Which software versions are affected by CVE-2022-29181?

The affected software versions are Nokogiri prior to version 1.13.6 and Apple macOS Ventura up to version 13.1.

4

How can I mitigate the risk of CVE-2022-29181?

To mitigate the risk of CVE-2022-29181, update Nokogiri to version 1.13.6 and Apple macOS Ventura to version 13.1.

5

Where can I find more information about CVE-2022-29181?

More information about CVE-2022-29181 can be found at the following references: [Apple Support](https://support.apple.com/en-us/HT213532), [GitHub Security Advisory](https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m), [NVD](https://nvd.nist.gov/vuln/detail/CVE-2022-29181).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203