CVE-2026-57235: CWE-125: Out-of-bounds Read in sparklemotion nokogiri
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri::XML::NodeSet#[] (and its alias #slice) checked the requested index against the node set's bounds using a 32-bit-truncated copy of the index. A large negative index could pass the check and then be used at full width, reading outside the node set's storage. On CRuby this is an out-of-bounds read that typically crashes the process; on JRuby it is not memory-unsafe but returns an incorrect node. This vulnerability is fixed in 1.19.4.
AI Analysis
Technical Summary
CVE-2026-57235 describes an out-of-bounds read vulnerability in the Nokogiri library for Ruby, specifically in the NodeSet indexing methods (#[] and #slice). The vulnerability arises because the index is checked against the node set bounds using a 32-bit truncated copy, allowing a large negative index to pass the check but then be used at full width, resulting in reading memory outside the intended storage. This leads to process crashes on CRuby and incorrect node returns on JRuby. The issue is resolved in Nokogiri version 1.19.4.
Potential Impact
On CRuby, exploitation of this vulnerability typically causes a process crash due to out-of-bounds memory reads. On JRuby, it does not cause memory corruption but returns incorrect data, potentially leading to application logic errors. There is no indication of remote code execution or privilege escalation. The CVSS 4.0 score is 6.3 (medium severity), reflecting a network attack vector with low complexity and partial attack prerequisites.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this vulnerability is fixed. No other mitigation is indicated or required.
CVE-2026-57235: CWE-125: Out-of-bounds Read 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::NodeSet#[] (and its alias #slice) checked the requested index against the node set's bounds using a 32-bit-truncated copy of the index. A large negative index could pass the check and then be used at full width, reading outside the node set's storage. On CRuby this is an out-of-bounds read that typically crashes the process; on JRuby it is not memory-unsafe but returns an incorrect node. This vulnerability is fixed in 1.19.4.
CVSS v4.0
Score 6.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-57235 describes an out-of-bounds read vulnerability in the Nokogiri library for Ruby, specifically in the NodeSet indexing methods (#[] and #slice). The vulnerability arises because the index is checked against the node set bounds using a 32-bit truncated copy, allowing a large negative index to pass the check but then be used at full width, resulting in reading memory outside the intended storage. This leads to process crashes on CRuby and incorrect node returns on JRuby. The issue is resolved in Nokogiri version 1.19.4.
Potential Impact
On CRuby, exploitation of this vulnerability typically causes a process crash due to out-of-bounds memory reads. On JRuby, it does not cause memory corruption but returns incorrect data, potentially leading to application logic errors. There is no indication of remote code execution or privilege escalation. The CVSS 4.0 score is 6.3 (medium severity), reflecting a network attack vector with low complexity and partial attack prerequisites.
Mitigation Recommendations
Upgrade Nokogiri to version 1.19.4 or later, where this vulnerability is fixed. No other mitigation is indicated or required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-24T02:21:33.812Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a3d3f304853345fc113d17f
Added to database: 06/25/2026, 14:46:08 UTC
Last enriched: 06/25/2026, 15:01:59 UTC
Last updated: 06/26/2026, 01:45:56 UTC
Views: 9
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.