Skip to main content

Nokogiri CVE-2026-57434

| EUVDEUVD-2026-39424 LOW
NULL Pointer Dereference (CWE-476)
2026-06-25 GitHub_M
1.7
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Developer writes code calling .allocate on native Nokogiri class
  2. Delivery
    Object allocated without C native pointer
  3. Exploit
    Method invoked on uninitialized object
  4. Execution
    NULL pointer dereference in C extension
  5. Persist
    Ruby process crashes
  6. Impact
    Application availability lost

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Null pointer safety, defensive checks
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires application source code to explicitly call Ruby's .allocate method on a Nokogiri class that inherits from Nokogiri::XML::Node and then invoke any method on the resulting uninitialized instance. This is a programming error that violates Nokogiri's documented API contract - it cannot be triggered through normal library use, by parsing untrusted XML or HTML documents, or by any network-delivered or user-supplied input. JRuby deployments are entirely unaffected regardless of code patterns. Exploitation is therefore bounded to CRuby applications containing the specific anti-pattern of direct .allocate usage, which is an uncommon and unsupported usage pattern absent from standard Nokogiri documentation.

Impact

Real-world risk is very low across all available signals. The CVSS 4.0 base score of 1.7 with E:U (unexploited evidence) and AT:P (attack requirements present) correctly encodes that exploitation is conditioned on a non-standard, undocumented code pattern. The vendor advisory explicitly confirms that untrusted external input - including malformed documents or malicious file uploads - cannot trigger this flaw; only application code that directly calls .allocate on a Nokogiri native class reaches the vulnerable path. Availability impact is limited to VA:L, meaning a single process crash rather than a system-wide outage. No EPSS data was supplied, but given the narrow exploitation conditions, real-world probability would be negligible. There is no CISA KEV listing and no public exploit code. This vulnerability represents a library hardening fix of interest during routine upgrade cycles, not an emergency requiring out-of-band patching.

Exploit ScenarioDerived

A Ruby application contains a code path where a developer has mistakenly called .allocate on a Nokogiri native-backed class - for instance, Nokogiri::XML::Node.allocate - and subsequently invokes a standard Nokogiri method on the resulting uninitialized object. This dereferences a NULL C pointer in the native extension, crashing the Ruby process and causing a denial of service for that application instance. No public exploit code exists, and no external attacker-controlled input is required to reach this path.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 25, 2026

Null pointer dereference in Nokogiri prior to 1.19.4 crashes the Ruby process when application code incorrectly calls .allocate directly on a native-backed class inheriting from Nokogiri::XML::Node and then invokes methods on the resulting uninitialized object. Only CRuby is affected - JRuby is explicitly not vulnerable. No public exploit has been identified; the CVSS 4.0 base score of 1.7 with E:U accurately reflects that this defect requires a developer programming error rather than any crafted external input, placing it firmly in the low-priority category.

RemediationAI

Vendor-released patch: 1.19.4. Upgrade Nokogiri to version 1.19.4 or later using gem update nokogiri or, in Bundler-managed projects, by updating the version constraint in Gemfile and running bundle update nokogiri. The fix is confirmed in GitHub Security Advisory GHSA-9cv2-cfxc-v4v2 at https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-9cv2-cfxc-v4v2. As a code-level workaround that eliminates the condition entirely without upgrading, audit all application code for direct calls to .allocate on any Nokogiri class (e.g., Nokogiri::XML::Node.allocate, Nokogiri::XML::Document.allocate) and replace them with documented constructors and factory methods such as Nokogiri::XML::Document.new or Nokogiri::HTML5::Document.parse. This workaround carries no functional trade-offs because direct .allocate usage on native-backed Nokogiri classes is an undocumented and unsupported pattern.

Affected VersionsENISA

nokogiri < 1.19.4

Affected Packages

rubygems nokogiri fix: 1.19.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Nokogiri (CPE: cpe:2.3:a:sparklemotion:nokogiri:*:*:*:*:*:*:*:*) is a widely used Ruby gem that wraps libxml2 and libxslt for XML and HTML parsing via a native C extension. Its object lifecycle assumes that all instances are created through documented constructors and factory methods, which properly initialize the underlying C data pointer. Ruby's built-in .allocate method bypasses this initialization, producing an object whose native pointer is NULL. When any Nokogiri method subsequently dereferences that pointer, the process crashes - a classic CWE-476 (NULL Pointer Dereference) defect. Nokogiri 1.19.4 introduces explicit NULL-pointer guards at the method entry points that raise a Ruby RuntimeError before the unsafe dereference occurs, converting a silent crash into a catchable exception.

Know when Nokogiri gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 1.7 LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U
vuln.today AI 3.7 LOW

AC:H reflects the specific developer anti-pattern prerequisite; A:L captures process-level crash only; no confidentiality or integrity impact applies.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
Patch available
Jun 25, 2026 - 16:03 EUVD

DescriptionCVE.org

Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri contains a bug when calling certain methods on allocated-but-uninitialized native wrapper classes that inherit from Nokogiri::XML::Node. This caused a NULL pointer dereference that could crash the process. This vulnerability is fixed in 1.19.4.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
High
most-downloaded Ruby gem, widely used across Ruby web applications
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity LOW
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact· derived
High
Technical Impact
Partial

Priority Score

8
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +8
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A null pointer dereference occurs when a program attempts to access memory through a pointer that has been set to NULL (address 0x0).

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2022-29181 HIGH POC
8.2 May 20

Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 8.2), this vulnerability is remotely

CVE-2019-5477 CRITICAL
9.8 Aug 16

A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via Rub

CVE-2026-79770 HIGH
8.7 Aug 25

Denial-of-service in Nokogiri before 1.19.3 stems from three distinct ReDoS vulnerabilities in the CSS selector tokenize

CVE-2026-79769 HIGH
8.7 Aug 25

Out-of-bounds memory read in Nokogiri (CRuby) versions before 1.19.4 crashes the host Ruby process when application code

CVE-2022-23476 HIGH
7.5 Dec 08

Nokogiri is an open source XML and HTML library for the Ruby programming language. Rated high severity (CVSS 7.5), this

CVE-2022-24836 HIGH
7.5 Apr 11

Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 7.5), this vulnerability is remotely

CVE-2021-41098 HIGH
7.5 Sep 27

Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. Rated high sever

CVE-2026-79771 MEDIUM
6.9 Aug 25

Heap memory leaks in Nokogiri's XSLT transform method (versions before 1.19.3) enable gradual denial of service against

CVE-2026-79772 MEDIUM
6.9 Aug 25

Unchecked return value in Nokogiri's CRuby extension (versions 1.5.1 through 1.19.0) causes the `canonicalize` method to

CVE-2026-57235 MEDIUM
6.3 Jun 25

Out-of-bounds read in Nokogiri's `NodeSet#[]` method (all versions before 1.19.4) enables an attacker who can supply a l

CVE-2020-26247 MEDIUM
4.3 Dec 30

Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. Rated medium sev

CVE-2026-57234 LOW
2.6 Jun 25

NONET network restriction bypass in Nokogiri's JRuby implementation permits external resource fetching during XML Schema

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy