CVE-2026-126064
Low 2.0No known exploitationFix availableNokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Node#[]=` or `#lang=`
Vendor advisory: GHSA-3w22-6jfg-527w
Record last updated
CVSS score
Low on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
No EPSS score available
CISA remediation deadline
Not in the KEV catalog
Description
### Summary Nokogiri's CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an existing XML attribute via `Nokogiri::XML::Node#[]=` or `Nokogiri::XML::Node#lang=`. If Ruby code had already accessed the attribute's child nodes, replacing the value could free those native child nodes while their wrappers remained reachable. Using one of those child nodes afterwards could cause an invalid read and a possible segfault. This is the same class of issue as [GHSA-phwj-rprq-35pp](https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-phwj-rprq-35pp), which was fixed for `Attr#value=` in Nokogiri 1.19.4. Nokogiri 1.19.5 preserves all already-wrapped attribute child nodes before replacing the attribute value. JRuby is not affected. ### Severity The Nokogiri maintainers have evaluated this as low severity. Reaching it requires an unusual API-usage pattern that does not arise during normal use. The application must directly access an attribute's child nodes and then replace that same attribute's value via `Node#[]=` or `Node#lang=`. Nokogiri 1.19.5 makes this pattern safe with no change to the public API. ### Mitigation Upgrade to N…
Weakness: CWE-416
Patching and mitigation
- Patch status
- Fix available (source: Microsoft MSRC)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl3 rubygem-nokogiri 1.19.4-1 on Azure Linux 3.0 | Not documented | 1.19.7-1 | Microsoft MSRC |
| Microsoft | azl4 rubygem-nokogiri 1.19.4-5.azl4 on Azure Linux 4.0 | Not documented | 0:1.19.7-1.azl4 | Microsoft MSRC |
| rubygems | nokogiri | all versions before 1.19.5 | 1.19.5 | GitHub Advisory Database |
Timeline
Advisory
Microsoft advisory published
Advisory change
Microsoft advisory revised (2.0): Information published.
Advisory change
Microsoft advisory revised (3.0): Information published.
Advisory change
Microsoft advisory revised (4.0): Information published.
Advisory change
Microsoft advisory revised (5.0): Information published.
Patch
Fix documented by Microsoft MSRC
Vendor guidance and references
- Microsoft Security Update Guide (opens in a new tab)vendor-advisory
- GitHub Advisory GHSA-3w22-6jfg-527w (opens in a new tab)github-advisory