Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2022-29181
Ruby vulnerability analysis and mitigation

Overview

Nokogiri prior to version 1.13.6 contained a vulnerability (CVE-2022-29181) that does not type-check all inputs into the XML and HTML4 SAX parsers. The vulnerability was discovered in May 2022 and affects the open-source XML and HTML library for Ruby. This security issue allows specially crafted untrusted inputs to cause illegal memory access errors (segfault) or reads from unrelated memory (NVD, GitHub Advisory).

Technical details

The vulnerability stems from type confusion issues in both xml_sax_parser_context.c and html4_sax_parser_context.c files. The parse_memory function fails to verify that the input data is a Ruby string before processing, allowing attackers to pass non-string objects that could cause memory access violations. The issue has been assigned a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H (GitHub Lab).

Impact

For CRuby users, this vulnerability could lead to denial of service (DoS) through application crashes or potential information disclosure through memory leaks. If Nokogiri is being used in a way that reflects parsing results to the attacker, the vulnerability could be exploited to leak arbitrary Ruby strings containing sensitive information by guessing valid memory addresses (GitHub Lab).

Exploitability

The vulnerability can be exploited by providing specially crafted input to the XML and HTML4 SAX parsers. A proof of concept exists that demonstrates how the process can be crashed by dereferencing invalid memory addresses. JRuby users are not affected by this vulnerability (GitHub Advisory).

Mitigation and workarounds

Users should upgrade to Nokogiri version 1.13.6 or later which contains a patch for this vulnerability. As a temporary workaround, users can ensure untrusted input is converted to a String by calling #to_s or equivalent before passing it to the parser (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Alpine

Fixed

edge

ruby-nokogiri: 1.13.6-r0

Fixed

v3.18

ruby-nokogiri: 1.13.6-r0

Fixed

v3.19

ruby-nokogiri: 1.13.6-r0

Fixed

v3.20

ruby-nokogiri: 1.13.6-r0

Fixed

v3.21

ruby-nokogiri: 1.13.6-r0

Fixed

v3.22

ruby-nokogiri: 1.13.6-r0

Fixed

v3.23

ruby-nokogiri: 1.13.6-r0

Fixed

SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-50276HIGH7.5
  • Ruby logoRuby
  • datadog
NoYesSep 14, 2026
CVE-2026-70658HIGH7.4
  • Ruby logoRuby
  • pay
NoNoSep 14, 2026
CVE-2026-44163MEDIUM5.3
  • Ruby logoRuby
  • fluent-plugin-opentelemetry
NoYesSep 15, 2026
CVE-2026-44282MEDIUM4.8
  • Ruby logoRuby
  • decidim-elections
NoYesSep 15, 2026
CVE-2026-44162LOW2.7
  • Ruby logoRuby
  • fluent-plugin-s3
NoYesSep 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management