CVE-2026-57437: CWE-416: Use After Free in sparklemotion nokogiri
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri::XML::XPathContext did not keep its source document alive for garbage collection. If an XPathContext outlived its document and the document was collected, evaluating an XPath expression could read invalid memory and potentially segfault. This is only reachable when application code constructs an XPathContext directly and lets the document become unreachable while continuing to use the context. The normal Document#xpath, #css, and related search methods are not affected, and it is not triggerable by malicious document input. This vulnerability is fixed in 1.19.4.
AI Analysis
Technical Summary
CVE-2026-57437 is a use-after-free vulnerability (CWE-416) in the Nokogiri Ruby library affecting versions prior to 1.19.4. The Nokogiri::XML::XPathContext class did not maintain a reference to its source document, allowing the document to be garbage collected while the XPathContext remained in use. This could cause evaluation of XPath expressions to read invalid memory, potentially causing segmentation faults. The vulnerability is only reachable when application code manually constructs an XPathContext and the document becomes unreachable during continued use. Normal Nokogiri search methods are unaffected, and the vulnerability is not triggered by malicious input. The issue is resolved in Nokogiri 1.19.4.
Potential Impact
The vulnerability can lead to application crashes (segmentation faults) due to use-after-free memory access when XPathContext outlives its source document. There is no indication of remote code execution or data corruption. It is not exploitable via crafted XML/HTML input and requires specific application code patterns to trigger. The CVSS 4.0 score is low (1.7), reflecting limited impact and exploitability.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this use-after-free vulnerability is fixed. No other mitigation is required as the vulnerability is not exploitable via malicious input and only occurs in specific application usage patterns.
CVE-2026-57437: CWE-416: Use After Free in sparklemotion nokogiri
Description
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri::XML::XPathContext did not keep its source document alive for garbage collection. If an XPathContext outlived its document and the document was collected, evaluating an XPath expression could read invalid memory and potentially segfault. This is only reachable when application code constructs an XPathContext directly and lets the document become unreachable while continuing to use the context. The normal Document#xpath, #css, and related search methods are not affected, and it is not triggerable by malicious document input. This vulnerability is fixed in 1.19.4.
CVSS v4.0
Score 1.7low
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-57437 is a use-after-free vulnerability (CWE-416) in the Nokogiri Ruby library affecting versions prior to 1.19.4. The Nokogiri::XML::XPathContext class did not maintain a reference to its source document, allowing the document to be garbage collected while the XPathContext remained in use. This could cause evaluation of XPath expressions to read invalid memory, potentially causing segmentation faults. The vulnerability is only reachable when application code manually constructs an XPathContext and the document becomes unreachable during continued use. Normal Nokogiri search methods are unaffected, and the vulnerability is not triggered by malicious input. The issue is resolved in Nokogiri 1.19.4.
Potential Impact
The vulnerability can lead to application crashes (segmentation faults) due to use-after-free memory access when XPathContext outlives its source document. There is no indication of remote code execution or data corruption. It is not exploitable via crafted XML/HTML input and requires specific application code patterns to trigger. The CVSS 4.0 score is low (1.7), reflecting limited impact and exploitability.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this use-after-free vulnerability is fixed. No other mitigation is required as the vulnerability is not exploitable via malicious input and only occurs in specific application usage patterns.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-24T13:21:20.729Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a3d3f314853345fc113d1c0
Added to database: 06/25/2026, 14:46:09 UTC
Last enriched: 06/25/2026, 15:01:29 UTC
Last updated: 06/26/2026, 00:01:22 UTC
Views: 8
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.