Skip to main content

Nokogiri EUVDEUVD-2026-39429

| CVE-2026-57438 LOW
Use After Free (CWE-416)
2026-06-25 GitHub_M
2.2
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Parse XML document without xinclude parse option
  2. Delivery
    Traverse xi:include subtree and bind child nodes/namespaces to Ruby objects
  3. Exploit
    Invoke do_xinclude on document
  4. Execution
    libxml2 frees bound C structures
  5. Persist
    Ruby objects become dangling pointers
  6. Impact
    Access freed memory causing invalid read or write

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

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

Exploitation Conditions

Exploitation requires a specific, non-default three-step API usage pattern: (1) the application must parse an XML document WITHOUT the xinclude parse option - meaning XInclude processing is intentionally deferred; (2) the application must then traverse into an <xi:include> element's subtree and bind one or more child nodes (e.g., <xi:fallback> descendants) or namespace objects declared on those nodes to live Ruby object references; and (3) the application must subsequently call #do_xinclude on the same document. The vastly more common pattern - enabling xinclude as a parse option - is not affected because no application-level Ruby bindings to those nodes exist yet. Additionally, only CRuby (MRI) is affected; JRuby users face no risk regardless of API usage. Exploitation would be limited to processes where an attacker can influence how the application calls the Nokogiri API, making this primarily a developer-introduced vulnerability rather than an externally injectable attack surface.

Impact

Real-world risk is low despite the memory-corruption class of the bug. The CVSS 4.0 vector (AV:L/AC:H) correctly captures that this is not a remotely triggerable network service flaw - it is a library API misuse pattern that can only manifest inside an application process that calls Nokogiri in a specific, non-standard three-step sequence. The Nokogiri maintainers independently rate severity as low, consistent with the 2.2 score. No EPSS data was provided; CISA KEV status is absent, confirming no known active exploitation. No public proof-of-concept code is referenced. The CVSS 4.0 metrics show VA:H (availability High) as the dominant impact, reflecting crash potential, while VC:L/VI:L indicate limited confidentiality and integrity impact - full deterministic code execution is not implied by the available data. There is no conflict between the CVSS signals and the description; they are mutually consistent. This is a genuine low-priority issue for most deployments: applications using XInclude at parse time (the common case) are not affected, and the fix requires only a gem upgrade with no application code changes.

Exploit ScenarioDerived

An application parses an XML document without the xinclude parse option, then iterates into an <xi:include> element's subtree - for example, reading attribute values from an <xi:fallback> child or collecting declared namespaces - binding those objects to Ruby variables. When the application subsequently calls document.do_xinclude, libxml2 frees the underlying C structures for those nodes, leaving the previously bound Ruby objects as dangling pointers into freed memory. Continued access to those Ruby objects (such as printing a node's content or checking a namespace URI) triggers invalid memory reads or writes, potentially crashing the process or disclosing adjacent heap contents. No public proof-of-concept exploit has been identified at time of analysis.

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

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

Alert me

AnalysisAIv1 – Jun 25, 2026

Use-after-free in Nokogiri's CRuby XInclude processing (versions prior to 1.19.4) can leave Ruby wrapper objects pointing at freed libxml2 memory after #do_xinclude is called on a document whose nodes have already been exposed to Ruby. An application that triggers this condition may experience invalid memory reads or writes, potentially resulting in a crash or memory disclosure. No public exploit has been identified at time of analysis, and the CVSS 4.0 score of 2.2 reflects the high attack complexity driven by an unusual, non-default API usage pattern required to reach the vulnerable code path.

RemediationAI

Upgrade Nokogiri to version 1.19.4 or later, which is the vendor-released patch confirmed by the maintainers via GHSA-wfpw-mmfh-qq69. The patched release introduces defensive copy behavior in #do_xinclude and requires no changes to application code. For applications that cannot immediately upgrade, the maintainers provide a specific workaround: perform XInclude substitution at parse time by passing the xinclude parse option (e.g., Nokogiri::XML(xml_string, &:xinclude)) rather than calling #do_xinclude on a document that has already been traversed. A freshly parsed document has no internal nodes yet exposed to Ruby object bindings, so the substitution is safe. The trade-off is that this workaround changes when XInclude processing occurs and may not suit applications that intentionally separate parsing from XInclude resolution. See https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-wfpw-mmfh-qq69 for full mitigation guidance.

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 is the dominant XML and HTML parsing library for Ruby, wrapping libxml2 at the C extension layer in its CRuby (MRI) implementation. The vulnerable code path is Nokogiri::XML::Node#do_xinclude, which invokes libxml2's XInclude substitution engine. During substitution, libxml2 replaces each <xi:include> element in the document tree in place, freeing that element along with its children (<xi:fallback> and descendants) and any XML namespaces declared on them. Nokogiri's Ruby object layer wraps these libxml2 C structures by pointer; when libxml2 frees a structure that a Ruby object already references, the Ruby object becomes a dangling pointer - a textbook CWE-416 (Use After Free). The fix in 1.19.4 changes #do_xinclude to operate on a defensive copy of the relevant subtrees so that libxml2 only ever frees structures with no live Ruby bindings. The CPE is cpe:2.3:a:sparklemotion:nokogiri:*:*:*:*:*:*:*:* with versions below 1.19.4. The JRuby implementation uses a different XML backend and is explicitly not affected.

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 2.2 LOW
CVSS:4.0/AV:L/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N/E:U
vuln.today AI 6.2 MEDIUM

AV:L because vulnerability triggers only inside local application code calling the library API; AC:H reflects the unusual three-step misuse pattern required; no OS-level privileges needed to invoke a Ruby method (PR:N).

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

1
Patch available
Jun 25, 2026 - 17:02 EUVD

DescriptionCVE.org

Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, XInclude substitution performed by Nokogiri::XML::Node#do_xinclude replaced each <xi:include> in place, freeing the include node along with its children (such as <xi:fallback> and its descendants) and any namespaces declared on them. If an application had already exposed one of those nodes or namespaces to Ruby, the corresponding Ruby object was left pointing at freed memory. Using the object could result in invalid reads or writes to memory. This vulnerability is fixed in 1.19.4.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
High
dominant XML/HTML parser for Ruby, installed across millions of Ruby projects
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.1%
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
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

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

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

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