Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Node#[]=` or `#lang=`
CVE-2026-126064Published 10 Nov 2026, 20:17 UTC
Real-world risk
0.3/ 10Low
Routine
If the vulnerable configuration applies to you: 0.6
PreliminaryFrom the CVSS vector only · confidence low
CVSS
2.0
scored by the vendor (CNA), CVSS 4.0
In plain words
No plain-language summary yet. The original description is below.
Original description (from GitHub_M)
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.5, the CRuby native extension can leave Ruby wrappers pointing to freed memory when Nokogiri::XML::Node#[]= or Nokogiri::XML::Node#lang= replaces an existing attribute value after code has accessed the attribute's child nodes. Replacing the value frees native child nodes while their wrappers remain reachable, and later use of those wrappers can cause an invalid read or process segfault. JRuby is not affected. This issue is fixed in version 1.19.5.
Am I affected?
| Product | Affected versions (from the sources) | Fixed in |
|---|---|---|
| nokogiriNiche | < 1.19.5 | 1.19.5 |
What to do
Update to a fixed version: 1.19.5.
Why this score
| Factor | Value | Evidence | × |
|---|---|---|---|
| Impact | MinorReflected XSS, CSRF with low effect, open redirect, minor leak | From the CVSS vector | 0.30 |
| Attacker position | LocalMust already run code or have a shell on the machine | From the CVSS vector | 0.50 |
| Privileges needed | LowA real low-privileged account | From the CVSS vector | 1.00 |
| Victim interaction | NoneNothing | From the CVSS vector | 1.00 |
| Configuration | UncommonNeeds a non-default feature that a minority enables | From the CVSS vector | 0.45 |
| Reliability | HardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bug | From the CVSS vector | 0.45 |
Threat level T1: Nothing known (× 0.85)
The default for a new disclosure
EPSS 0.2% chance of exploitation in 30 days (percentile 5), as of 2026-12-05.
The arithmetic
- Prerequisites multiplied together0.101
- Threat T1: Nothing known0.850
- 10 × impact 0.3 × prerequisites 0.1013 × threat 0.850.258
- Rounded to one decimal between 0.1 and 100.3
Exploitation and evidence timeline
- 10 Nov 2026 Published
- 3 Dec 2026 Risk 0.3 (cvss fallback)
Weakness
CWE-416
References
- https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-3w22-6jfg-527wvendor-advisory
- https://github.com/sparklemotion/nokogiri/pull/3752misc
- https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425misc
- https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6fmisc
- https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5misc
- CVE-2026-126064 on CVE.org