Skip to main content

Nokogiri CVE-2026-57435

| EUVDEUVD-2026-39426 LOW
Use After Free (CWE-416)
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
    Supply crafted XML/HTML to target application
  2. Delivery
    Application accesses attribute child node via Attr#child
  3. Exploit
    Application calls Attr#value= on same attribute
  4. Execution
    Native C child node freed, Ruby wrapper retained in document cache
  5. Persist
    GC mark traversal or direct access dereferences freed pointer
  6. Impact
    Process segfault causes application crash

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

Three specific conditions must all be true simultaneously: (1) the deployment uses the CRuby native extension - JRuby is not affected; (2) application code accesses an XML attribute's child node via Attr#child or a similar accessor, creating a Ruby wrapper retained in the document node cache; and (3) the same application code subsequently calls Attr#value= or #content= on that same attribute, triggering the native free. Nokogiri maintainers confirm this combination does not arise during normal XML processing and is limited to unusual, direct attribute-child-node manipulation patterns. Exploitation is further bounded to availability impact only - a crash or invalid read - with no path to confidentiality or integrity compromise. The AV:N in the CVSS vector reflects that Nokogiri commonly processes network-supplied XML, but the triggering code sequence must be present in application logic, not purely in attacker-controlled input.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U) yields a score of 1.7, accurately capturing that impact is limited to a potential availability disruption with zero confidentiality or integrity consequence. The AT:P (attack requirements present) modifier is the decisive limiting factor: the application must first access an attribute child node and then mutate that same attribute, a pattern the Nokogiri maintainers explicitly characterize as unusual and absent from normal use. The E:U (exploit unreported) supplemental metric aligns with the absence of any KEV listing or POC. No EPSS score was provided in source data; exploitation probability is inferred as very low from these combined signals. This is a genuine low-severity issue - not a case of high CVSS masking low real risk, but a vulnerability whose CVSS accurately reflects limited blast radius. The primary operational concern is unexpected process crashes in applications that happen to exercise the unusual API pattern, not attacker-controlled code execution or data exfiltration.

Exploit ScenarioDerived

An application processing externally supplied XML that first reads an attribute's child node (e.g., attr.child to inspect text structure) and then replaces the attribute's value in the same code path triggers the freed-pointer condition. If the Ruby GC runs before the next use of the stale wrapper, the process segfaults, causing a denial-of-service crash. No public exploit code exists at time of analysis, and reproduction requires application-controlled code rather than purely attacker-supplied input.

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

Use-after-free in Nokogiri's CRuby native extension (versions prior to 1.19.4) can corrupt process memory or cause a segfault when an application accesses an XML attribute's child node and subsequently replaces that attribute's value via Attr#value= or #content=. The underlying libxml2 wrapper frees the native child node while a Ruby object in the document node cache retains a stale pointer, which a later GC mark pass or direct access can dereference. With a CVSS 4.0 score of 1.7, no KEV listing, and no public exploit identified at time of analysis, real-world risk is low and constrained to application availability.

RemediationAI

Upgrade to Nokogiri 1.19.4 or later - vendor-released patch confirmed at https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-phwj-rprq-35pp. The fix preserves any already-wrapped attribute child nodes before replacing the attribute value, eliminating the use-after-free with no change to the public API. Where immediate upgrade is not feasible, audit application code and avoid accessing attribute child nodes via Attr#child or equivalent accessors before calling Attr#value= or #content= on the same attribute. This workaround eliminates the triggering pattern but requires code review for every Nokogiri XML mutation site; the risk of missing an instance makes upgrading strongly preferred.

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 wraps libxml2 via a CRuby native C extension and maintains a document node cache that maps live Ruby wrapper objects to their underlying C-layer nodes. CWE-416 (Use After Free) occurs in the attribute-mutation path: when Nokogiri::XML::Attr#value= or #content= replaces an attribute's value, it frees the native child node, but any Ruby wrapper previously obtained via Attr#child or similar accessors remains referenced in the document cache with a now-invalid pointer. A subsequent Ruby garbage-collector mark traversal or explicit use of the stale wrapper dereferences freed memory, producing an invalid read and potentially a segfault. The JRuby implementation uses a pure Java code path and is entirely unaffected. CPE cpe:2.3:a:sparklemotion:nokogiri:*:*:*:*:*:*:*:* covers all versions through 1.19.3.

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

AV:N retained because Nokogiri processes external input; AC:H reflects the unusual application-code pattern required; only low availability impact, no C or I consequence.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
4.0 AV:N/AC:L/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’s CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an XML attribute. If Ruby code had already accessed an attribute child node, Nokogiri::XML::Attr#value= could free the underlying native child node while the wrapper remained reachable through the document node cache. A later use of the freed child node or a Ruby GC mark could dereference an invalid pointer, causing an invalid read and a possible segfault. This vulnerability is fixed in 1.19.4.

Threat Intelligence Overview

EPSS Score
0.3%
Top 75% exploitable
Prevalence
High
core XML/HTML parsing dependency across Ruby and Rails ecosystems
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
No
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

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