NetSight
low2.0

CVE-2026-126064

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

Impact

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.

An attacker can exploit this with local access to the system, with a regular user account, without any action by a user. Specific conditions have to be met, which makes an attack harder. If it succeeds: low risk of outages.

Affected packages

EcosystemPackageAffectedFixed in
rubygemsnokogiri< 1.19.51.19.5

Affected products · Sparklemotion

ProductAffected versions
Nokogiri
before 1.19.5
Version < 1.19.5

Weakness classification

References