Skip to main content

Nokogiri EUVDEUVD-2026-39422

| CVE-2026-57235 MEDIUM
Out-of-bounds Read (CWE-125)
2026-06-25 GitHub_M
6.3
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted large negative integer via user input
  2. Delivery
    Application forwards value to NodeSet#[] without validation
  3. Exploit
    32-bit truncation bypasses bounds check
  4. Execution
    Full-width index dereferences outside node set buffer
  5. Impact
    Out-of-bounds read crashes CRuby process or leaks heap memory

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

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

Exploitation Conditions

Exploitation requires that the target Ruby application pass an attacker-controlled integer directly to Nokogiri::XML::NodeSet#[] or #slice without first validating it against node_set.length. The crafted value must be a large negative integer whose 32-bit truncation wraps into the apparent in-bounds range while its full 64-bit representation indexes far outside the node set's allocated storage. On JRuby, no memory-unsafe condition is triggered regardless of the input - only CRuby (MRI Ruby) runtimes are subject to the out-of-bounds read, process crash, and potential heap disclosure. Applications that do not pass untrusted external data as a NodeSet index, or that pre-validate indices before use, are not exploitable. The CVSS AT:P metric explicitly encodes this application-level prerequisite as a required attack condition.

Impact

The CVSS 4.0 score of 6.3 (AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N) is broadly consistent with the technical evidence. The AT:P metric (Attack Requirements: Present) is the critical risk-limiting factor: exploitation depends entirely on the target application forwarding untrusted integer input to NodeSet#[] without prior validation, which is a non-trivial application-level prerequisite not present in the majority of Nokogiri consumers. No EPSS score was provided in the input data; no CISA KEV listing exists; and no public exploit code has been identified, making this a medium-priority finding rather than an emergency. The primary real-world impact is denial of service via process crash on CRuby; confidentiality impact (potential heap memory disclosure) is present but secondary and depends on an attacker's ability to observe output or timing. Integrity is not affected. JRuby deployments face no memory-safety risk. The vendor rates this medium severity, consistent with this assessment. The key takeaway: if your Ruby application indexes Nokogiri NodeSets with externally supplied integers, this is a genuine DoS and potential information-disclosure risk requiring prompt patching; if not, exposure is negligible.

Exploit ScenarioDerived

An attacker submits a crafted large negative integer - for instance via a web API parameter, URL segment, or user-supplied form field - that a Ruby application passes without validation as an index into a Nokogiri NodeSet. On CRuby, the 32-bit-truncated bounds check passes, but the full 64-bit index dereferences memory far outside the node set buffer, crashing the Ruby process and potentially exposing adjacent heap contents to an observer. No public exploit code has been identified; the scenario requires the application to expose this specific integer-to-NodeSet#[] code path to untrusted input.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.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

Out-of-bounds read in Nokogiri's NodeSet#[] method (all versions before 1.19.4) enables an attacker who can supply a large negative integer index to bypass a 32-bit-truncated bounds check and trigger a read outside the node set's allocated memory. On CRuby (MRI Ruby), this typically crashes the process - denial of service - with ancillary potential for heap memory disclosure; on JRuby, the runtime's managed memory prevents memory corruption, but an incorrect node is silently returned. No public exploit or active exploitation has been identified; exploitation requires the target application to forward attacker-controlled integers directly to the NodeSet#[] or #slice API.

RemediationAI

Upgrade to Nokogiri 1.19.4 or later, which performs the NodeSet bounds check against the full-width index, eliminating the integer truncation flaw (confirmed fix version per GHSA-5prr-v3j2-97mh: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5prr-v3j2-97mh). If an immediate upgrade is not possible, validate any externally supplied integer against node_set.length before passing it to NodeSet#[] or #slice - for example, raise or clamp the value if it falls outside (-node_set.length..node_set.length - 1). This workaround must be applied at every call site in the application and does not fix the underlying library defect; it carries the risk of missed call sites and adds maintenance burden. Alternatively, refactor application logic to avoid forwarding untrusted integers directly as NodeSet indices. JRuby deployments do not face memory-safety risk but should still upgrade to prevent silent incorrect-node retrieval, which can produce logic errors in XML processing workflows.

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 providing bindings to libxml2 and libxslt for XML and HTML parsing. The root cause (CWE-125, Out-of-bounds Read) is an integer-width mismatch in the bounds validation of Nokogiri::XML::NodeSet#[] and its alias #slice: the supplied index was compared against the node set's length using a 32-bit-truncated copy of the value, while the subsequent array access used the full native-width (64-bit) integer. A sufficiently large negative integer wraps around when truncated to 32 bits, appearing to fall within the valid range and passing the check, but then dereferences far outside the allocated buffer at full pointer width. This class of bug - comparing with a narrowed copy but indexing with the original - is a classic signed integer truncation vulnerability. The divergent impact between CRuby and JRuby is explained by runtime memory model differences: CRuby operates on raw native memory, making the out-of-bounds read a genuine safety violation, whereas JRuby's JVM-managed heap enforces array bounds independently, producing incorrect behavior rather than a memory hazard.

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 6.3 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
vuln.today AI 4.8 MEDIUM

AC:H because exploitation requires the application to forward attacker-controlled integers to NodeSet#[], a non-default code path; C:L for potential heap disclosure and A:L for process crash on CRuby; no integrity or scope impact.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L
4.0 AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
SUSE 8.2 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
Red Hat 5.9 MEDIUM

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
Low
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::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.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
High
widely-used Ruby XML/HTML parsing gem across web applications globally
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment MSRC Vendor 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.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
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

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

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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-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

CVE-2026-57438 LOW
2.2 Jun 25

Use-after-free in Nokogiri's CRuby XInclude processing (versions prior to 1.19.4) can leave Ruby wrapper objects pointin

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 16.0 Affected
SUSE Linux Enterprise High Availability Extension 16.1 Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Affected

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