Skip to main content

Nokogiri CVE-2025-71346

| EUVDEUVD-2025-210772 HIGH
Out-of-bounds Read (CWE-125)
2026-08-25 VulnCheck GHSA-2ph4-3vr8-f2m3
High
Disputed · 8.7 Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Supply crafted XML or attacker-influenced XSD to validation endpoint
  2. Exploit
    Trigger xmlSchemaIDCFillNodeTables with xsd:keyref and recursive identity constraints
  3. Execution
    Heap-based buffer under-read in libxml2
  4. Impact
    Application process crash or denial of service

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 application invoke Nokogiri's XML Schema validation in one of two specific configurations: (1) the application validates any XML document against an attacker-controlled or attacker-influenced XSD schema file - meaning the attacker can supply or tamper with the .xsd used for validation; or (2) the application validates attacker-supplied XML documents against a trusted, operator-controlled schema that already contains xsd:keyref in combination with recursively defined complex types that carry additional identity constraints - a non-default, purpose-specific schema design. Applications that perform no XSD schema validation, or that validate only against fully trusted schemas not using this xsd:keyref-plus-recursive-type pattern, are not exploitable. The CVSS 4.0 vector (PR:N) and MITRE's CVSS 3.1 vector (AV:L/AC:H) are in direct conflict - authentication requirements and attack vector cannot be stated with confidence from the available data. The specific schema feature combination required (xsd:keyref plus recursive types with identity constraints) constitutes a meaningful exploitation barrier not captured by the NVD score.

Impact

The available risk signals for this vulnerability are materially conflicting and require explicit reconciliation. The NVD-assigned CVSS 4.0 score of 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N/VA:H) implies a network-reachable, low-complexity, unauthenticated denial-of-service - a framing that would suggest urgency across virtually any deployment. However, MITRE's independent CVSS 3.1 assessment is 2.9 LOW (AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L), which characterizes the attack as locally constrained and high-complexity - a drastically different posture. The upstream libxml2 maintainer explicitly supports the low-severity reading, noting that exploitation requires the narrow combination of xsd:keyref, recursively defined types, and additional identity constraints. No CISA KEV listing exists, no EPSS data is available in the supplied intelligence, and no public exploit code has been identified. The realistic threat surface is narrow: only applications that perform XSD schema validation against attacker-influenced schemas or attacker-controlled XML documents meeting the specific structural requirements are exposed. The CVSS 4.0 score appears to reflect a worst-case library-level framing rather than the constrained real-world trigger conditions described by the maintainer. Defenders should treat this as a routine patch-cycle update rather than an emergency response item, while prioritizing upgrade for any pipeline that validates untrusted XSD schemas.

Exploit ScenarioDerived

An attacker submits a crafted XSD schema or a specially structured XML document to a Ruby application that uses Nokogiri's XML Schema validation - for example, an API endpoint that accepts XML payloads and validates them. If the schema in use includes xsd:keyref references targeting recursively defined complex types with additional identity constraints, the crafted input drives libxml2's xmlSchemaIDCFillNodeTables into a heap-based buffer under-read, potentially crashing the application worker process and causing denial of service. No public exploit code is known at time of analysis, and the high attack complexity (requiring specific schema structural conditions) substantially limits opportunistic exploitation.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Aug 25, 2026

Heap-based buffer under-read in libxml2's XML Schema identity constraint processor affects all Nokogiri releases prior to 1.18.8, which bundle the vulnerable libxml2 library. The flaw in xmlSchemaIDCFillNodeTables can be triggered by supplying a crafted XSD schema or by submitting untrusted XML documents for validation against trusted schemas that combine xsd:keyref with recursively defined types carrying additional identity constraints. No public exploit has been identified at time of analysis, and upstream libxml2 maintainers and MITRE independently rate actual exploitability as low - in notable conflict with the NVD-assigned CVSS 4.0 base score of 8.7.

RemediationAI

The vendor-released patch is Nokogiri 1.18.8, which upgrades the bundled libxml2 to v2.13.8 and resolves CVE-2025-32415. Upgrade via 'gem update nokogiri' or pin 'gem "nokogiri", ">= 1.18.8"' in the Gemfile and run 'bundle update nokogiri'. The fix is confirmed in the vendor advisory at https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5w6v-399v-w3cc. As a compensating control prior to upgrading, applications can avoid passing untrusted, attacker-influenced XSD files as the schema argument to Nokogiri's validation methods - this eliminates the primary high-risk triggering condition. A secondary workaround is to disable XML Schema validation entirely for untrusted input and rely on application-layer validation instead, though this carries the trade-off of losing schema-enforced structural guarantees. Switching to a system-provided libxml2 package (if already updated to 2.13.8+) is viable but introduces a system-dependency management burden and may not be available on all deployment targets.

Affected VersionsENISA

nokogiri 0 <1.18.8

Affected Packages

rubygems nokogiri fix: 1.18.8

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 a widely used Ruby gem for XML and HTML parsing that bundles libxml2 as a native compiled dependency. The vulnerability - separately tracked as CVE-2025-32415 in the libxml2 project - is a CWE-125 (Out-of-Bounds Read) heap-based buffer under-read occurring in the xmlSchemaIDCFillNodeTables function within libxml2's xmlschemas.c. This function constructs internal lookup tables during XML Schema Definition (XSD) identity constraint validation, processing constructs such as xsd:keyref, xsd:key, and xsd:unique. The under-read is triggered when the schema contains xsd:keyref references in combination with recursively defined complex types that themselves carry additional identity constraints - causing the function to compute an incorrect buffer index. The affected CPE is cpe:2.3:a:sparklemotion:nokogiri:*:*:*:*:*:*:*:* for all versions below 1.18.8. Nokogiri installations that use system-provided libxml2 instead of the bundled version are only affected if the system libxml2 is itself below 2.13.8.

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

Sources disagree (Low–High)
Vendor (VulnCheck) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 3.7 LOW

Network-reachable via application input layer but AC:H due to required xsd:keyref/recursive-type schema structure; availability impact only, low severity consistent with MITRE assessment.

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:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
Red Hat 2.9 LOW

vuln.today treats the vendor’s rating as authoritative. A higher third-party CVSS (e.g. CISA-ADP) is shown for transparency but does not drive the headline severity.

CVSS VectorVendor: VulnCheck

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

Lifecycle Timeline

2
Patch available
Aug 25, 2026 - 17:17 EUVD
CVE Published
Aug 25, 2026 - 15:15 cve.org
HIGH 8.7

DescriptionCVE.org

Nokogiri before 1.18.8 packages a vulnerable version of libxml2 (before 2.13.8) that contains a heap-based buffer under-read (CVE-2025-32415) in the xmlSchemaIDCFillNodeTables function in xmlschemas.c. The issue can be triggered when validating against an untrusted XML Schema, or when validating untrusted documents against trusted schemas that use xsd:keyref in combination with recursively defined types that have additional identity constraints. Upstream and MITRE rate this issue as low severity.

Executive ViewAI

Why It Matters

Nokogiri versions prior to 1.18.8 contain a heap buffer vulnerability in XML schema validation that could enable data disclosure or denial of service when processing untrusted XML documents with specific constraint combinations. Organizations relying on Nokogiri for XML parsing should prioritize inventory and upgrade planning, though current risk is mitigated by the requirement for maliciously crafted schemas and low confirmed exploitability.

Business Impact: High
Compensating Controls

Vendor-released patch: Nokogiri 1.18.8 and later. Interim mitigations include: restricting XML schema processing to pre-vetted, documented schemas; disabling automatic schema discovery and remote schema loading; and validating all XSD inputs against a whitelist of approved schemas before instantiation.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
High
widely used Ruby XML/HTML parsing gem across Rails ecosystem
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment Vendor GitHub

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 HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
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-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

Vendor StatusVendor

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