NULL Pointer Dereference 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.36% (29th 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 NULL Pointer Dereference vulnerabilities in an interactive lesson.

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

Introduced: 19 Jun 2026

CVE-2026-57434  (opens in a new tab)
CWE-476  (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 NULL Pointer Dereference when certain methods are called on allocated-but-uninitialized native wrapper classes that inherit from Nokogiri::XML::Node. An attacker can cause the process to crash by invoking methods on objects created via direct calls to .allocate without proper initialization.

Note: This is only exploitable if application code directly calls .allocate on a native-backed class and then invokes methods on the resulting uninitialized object; it cannot be triggered by untrusted input or normal use of the public API.

Workaround

This vulnerability can be mitigated by avoiding direct calls to .allocate on native-backed classes and using documented constructors and factory methods instead.

CVSS Base Scores

version 4.0
version 3.1