CVE-2026-57438: 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, XInclude substitution performed by Nokogiri::XML::Node#do_xinclude replaced each <xi:include> in place, freeing the include node along with its children (such as <xi:fallback> and its descendants) and any namespaces declared on them. If an application had already exposed one of those nodes or namespaces to Ruby, the corresponding Ruby object was left pointing at freed memory. Using the object could result in invalid reads or writes to memory. This vulnerability is fixed in 1.19.4.
AI Analysis
Technical Summary
CVE-2026-57438 is a use-after-free vulnerability in the Nokogiri library before version 1.19.4. During XInclude substitution performed by Nokogiri::XML::Node#do_xinclude, the library replaced <xi:include> nodes in place, freeing the include node, its children (including <xi:fallback>), and any declared namespaces. If these nodes or namespaces had been exposed to Ruby, the corresponding Ruby objects would reference freed memory, leading to possible invalid memory access. The vulnerability is resolved in Nokogiri version 1.19.4.
Potential Impact
Exploitation of this vulnerability could lead to invalid reads or writes to memory due to use-after-free conditions in Ruby objects referencing freed XML nodes or namespaces. The CVSS 4.0 score is 2.2, indicating low severity with limited impact and high attack complexity. There are no known exploits in the wild.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this use-after-free vulnerability is fixed. No other mitigation or temporary workaround is indicated.
CVE-2026-57438: 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, XInclude substitution performed by Nokogiri::XML::Node#do_xinclude replaced each <xi:include> in place, freeing the include node along with its children (such as <xi:fallback> and its descendants) and any namespaces declared on them. If an application had already exposed one of those nodes or namespaces to Ruby, the corresponding Ruby object was left pointing at freed memory. Using the object could result in invalid reads or writes to memory. This vulnerability is fixed in 1.19.4.
CVSS v4.0
Score 2.2low
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-57438 is a use-after-free vulnerability in the Nokogiri library before version 1.19.4. During XInclude substitution performed by Nokogiri::XML::Node#do_xinclude, the library replaced <xi:include> nodes in place, freeing the include node, its children (including <xi:fallback>), and any declared namespaces. If these nodes or namespaces had been exposed to Ruby, the corresponding Ruby objects would reference freed memory, leading to possible invalid memory access. The vulnerability is resolved in Nokogiri version 1.19.4.
Potential Impact
Exploitation of this vulnerability could lead to invalid reads or writes to memory due to use-after-free conditions in Ruby objects referencing freed XML nodes or namespaces. The CVSS 4.0 score is 2.2, indicating low severity with limited impact and high attack complexity. There are no known exploits in the wild.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this use-after-free vulnerability is fixed. No other mitigation or temporary workaround is indicated.
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: 6a3d4d4d4853345fc124a368
Added to database: 06/25/2026, 15:46:21 UTC
Last enriched: 06/25/2026, 16:01:30 UTC
Last updated: 08/07/2026, 12:41:12 UTC
Views: 69
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.