Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply crafted XML/HTML to target application
-
DeliveryApplication accesses attribute child node via Attr#child
-
ExploitApplication calls Attr#value= on same attribute
-
ExecutionNative C child node freed, Ruby wrapper retained in document cache
-
PersistGC mark traversal or direct access dereferences freed pointer
-
ImpactProcess 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 |
| 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., |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
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
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 8.2), this vulnerability is remotely
A command injection vulnerability in Nokogiri v1.10.3 and earlier allows commands to be executed in a subprocess via Rub
Denial-of-service in Nokogiri before 1.19.3 stems from three distinct ReDoS vulnerabilities in the CSS selector tokenize
Out-of-bounds memory read in Nokogiri (CRuby) versions before 1.19.4 crashes the host Ruby process when application code
Nokogiri is an open source XML and HTML library for the Ruby programming language. Rated high severity (CVSS 7.5), this
Nokogiri is an open source XML and HTML library for Ruby. Rated high severity (CVSS 7.5), this vulnerability is remotely
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. Rated high sever
Heap memory leaks in Nokogiri's XSLT transform method (versions before 1.19.3) enable gradual denial of service against
Unchecked return value in Nokogiri's CRuby extension (versions 1.5.1 through 1.19.0) causes the `canonicalize` method to
Out-of-bounds read in Nokogiri's `NodeSet#[]` method (all versions before 1.19.4) enables an attacker who can supply a l
Nokogiri is a Rubygem providing HTML, XML, SAX, and Reader parsers with XPath and CSS selector support. Rated medium sev
NONET network restriction bypass in Nokogiri's JRuby implementation permits external resource fetching during XML Schema
EUVD-2026-39426
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB