# CVE-2026-126064: Nokogiri: Use-After-Free in Nokogiri when replacing an attribute value

- **Severity:** LOW 2.0
- **CVSS:** 2.0 (v4.0, CNA) `CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Attack requirements: Present; Privileges required: Low; User interaction: None; Confidentiality impact: None; Integrity impact: None; Availability impact: Low; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.14% (percentile 2, 2026-11-29)
- **CWE:** CWE-416
- **Aliases:** GHSA-3w22-6jfg-527w
- **Published:** 2026-11-10T20:17:13.658Z
- **Modified:** 2026-11-12T22:18:35.610Z

## Who should check

- Projects that depend on RubyGems package nokogiri (\< 1.19.5)
- Anyone running sparklemotion nokogiri \< 1.19.5

## Description

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.

## Affected and fixed versions

- RubyGems `nokogiri`: affected \< 1.19.5; fixed 1.19.5 (ghsa)
- sparklemotion nokogiri: \< 1.19.5 (cvelist)

## Technologies

RubyGems

## Mitigation

- Upgrade nokogiri to 1.19.5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-126064. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-126064.md
Affected: nokogiri < 1.19.5
Fixed in: 1.19.5

Steps:
1. Search this machine and project for nokogiri (RubyGems), sparklemotion nokogiri: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-126064 being exploited?

There is no confirmed exploitation: CVE-2026-126064 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.14% chance of exploitation in the next 30 days (as of 2026-11-29).

### How serious is CVE-2026-126064?

Low: CVSS 2.0 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-126064?

nokogiri \< 1.19.5.

### Is there a fix for CVE-2026-126064?

Yes. Fixed in 1.19.5. Upgrade nokogiri to 1.19.5 or later.

### How do I check if I'm affected by CVE-2026-126064?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-3w22-6jfg-527w>
- patch: <https://github.com/sparklemotion/nokogiri/pull/3752>
- patch: <https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425>
- patch: <https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6f>
- other: <https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5>
- other: <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/nokogiri/GHSA-3w22-6jfg-527w.yml>
- other: <https://github.com/advisories/GHSA-3w22-6jfg-527w>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-126064>
- GitHub Advisory Database: CC-BY 4.0 <https://github.com/advisories/GHSA-3w22-6jfg-527w> (license: <https://creativecommons.org/licenses/by/4.0/>)
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-126064> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-126064>
