# CVE-2026-126064: Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Node#[]=` or `#lang=`

- Severity: Low 2.0 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.15%, higher than 4% of CVEs (2026-12-01)
- Published: 2026-11-10T20:17:13.658Z
- Modified: 2026-11-12T22:18:35.610Z
- Also known as: GHSA-3w22-6jfg-527w
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- sparklemotion nokogiri: < 1.19.5
- nokogiri (RubyGems): before 1.19.5

## Every score

- GitHub_M: CVSS:4.0 2.0 Low `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`
- GitHub: CVSS:4.0 Low `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`

## References

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

## Sources

- CVE List: [CVE-2026-126064](https://www.cve.org/CVERecord?id=CVE-2026-126064), CVE Terms of Use, modified 2026-11-10
- GitHub Advisory Database: [GHSA-3w22-6jfg-527w](https://github.com/advisories/GHSA-3w22-6jfg-527w), CC-BY-4.0, modified 2026-11-10
- NVD: [CVE-2026-126064](https://nvd.nist.gov/vuln/detail/CVE-2026-126064), Public domain, modified 2026-11-12

---

Page: https://cve.day/CVE-2026-126064 · Whole record: https://cve.day/CVE-2026-126064.json · Rebuilt by cve.day 2026-11-25T22:59:50.270Z
