CVE-2026-57235 Details
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.
A moderate severity out-of-bounds read vulnerability has been identified in Nokogiri versions prior to 1.19.4. The issue arises in the Nokogiri::XML::NodeSet#[] method (and its alias #slice), where the index bounds are checked using a 32-bit-truncated version of the index. This flaw allows a large negative index to bypass the bounds check and access memory outside the node set's storage. In CRuby, this leads to a process crash, while in JRuby, it returns an incorrect node without causing memory safety issues. The vulnerability can be exploited by passing an attacker-controlled integer to the NodeSet#[] method, potentially causing a denial-of-service condition on CRuby or incorrect behavior on JRuby.
Users are advised to upgrade to Nokogiri version 1.19.4 or later. As a temporary workaround, applications can validate indices against the length of the node set before use or avoid using untrusted values as indices.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jun 25, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5prr-v3j2-97mh | [email protected] | MitigationVendor Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-125 | Out-of-bounds Read | [email protected] |
| CWE-190 | Integer Overflow or Wraparound | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| nokogiri nokogiri | < 1.19.4 |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Oct 25, 2026 | CVE Translated | [email protected] |
| Jun 26, 2026 | Initial Analysis | [email protected] |
| Jun 25, 2026 | CVE Modified | CISA-ADP |
| Jun 25, 2026 | New CVE Received | [email protected] |