Crash and memory disclosure via SAX type confusion
Published May 20, 2022 · Updated May 27, 2025
Type confusion in Nokogiri before 1.13.6 allows remote attackers to crash CRuby processes or disclose memory through SAX parser inputs. The XML and HTML4 parse_memory paths call RSTRING_LEN and StringValuePtr on data without first requiring a Ruby String, so non-String values are treated as string storage. Exploitation requires a CRuby application to pass an attacker-controlled object type into a SAX parser; the result is a process crash or, when parsing output is reflected and a memory address is guessed, disclosure of Ruby string data.
Summary
What happened
Type confusion in Nokogiri before 1.13.6 allows remote attackers to crash CRuby processes or disclose memory through SAX parser inputs. The XML and HTML4 parse_memory paths call RSTRING_LEN and StringValuePtr on data without first requiring a Ruby String, so non-String values are treated as string storage. Exploitation requires a CRuby application to pass an attacker-controlled object type into a SAX parser; the result is a process crash or, when parsing output is reflected and a memory address is guessed, disclosure of Ruby string data.
The record
- CVE
- CVE-2022-29181
- Published
- May 20, 2022
- Updated
- May 27, 2025
- Vendor
- Sparkle Motion
- Product
- Nokogiri
- Classifications
- CWE-241, CWE-843, T1499
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- May 20, 2022CVE publishedPublication date reported by the CVE source.
- May 27, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 1.13.6
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Ruby SAX parser crash proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo