CVE-2026-57235: Nokogiri: Possible Out-of-Bounds Read in `Nokogiri::XML::NodeSet#[]`
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.
Other sources
Nokogiri: Possible Out-of-Bounds Read in Nokogiri::XML::NodeSet#[]
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.19.4-1 - Upgrade
Upgrade
Nokogirito a version that resolves this vulnerability.Fixed in 1.19.4
Event History
Frequently Asked Questions
What is the severity of CVE-2026-57235?
The severity of CVE-2026-57235 is assessed as risk 27.
How do I fix CVE-2026-57235?
To fix CVE-2026-57235, update Nokogiri to version 1.19.4 or later.
What software is affected by CVE-2026-57235?
CVE-2026-57235 affects the Nokogiri library used in Ruby applications.
What vulnerability type is CVE-2026-57235 associated with?
CVE-2026-57235 is associated with an Integer Overflow vulnerability.
What is the issue caused by CVE-2026-57235?
CVE-2026-57235 allows for a possible out-of-bounds read in the Nokogiri::XML::NodeSet#[] method.