Integer Overflow or Wraparound Affecting nokogiri package, versions [,1.19.4)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.43% (36th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Integer Overflow or Wraparound vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-UNMANAGED-NOKOGIRI-17391933
  • published21 Jun 2026
  • disclosed19 Jun 2026
  • creditZheng Yu

Introduced: 19 Jun 2026

CVE-2026-57235  (opens in a new tab)
CWE-125  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade nokogiri to version 1.19.4 or higher.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound via the NodeSet#[] function. An attacker can cause a process crash or potentially access unintended memory by supplying a large negative integer as an index.

Note: This is only exploitable if an application passes attacker-controlled integers to the index parameter.

Workaround

This vulnerability can be mitigated by validating the index against node_set.length before use or avoiding the use of untrusted values as an index.

CVSS Base Scores

version 4.0
version 3.1