Vulnerability · Published Jun 25, 2026 · Assigned by GitHub_M

CVE-2026-57435Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Attr#value=` or `#content=`

Low 1.7

In plain English

A low-severity use-after-free in nokogiri from sparklemotion. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 40% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)1.7Low
Exploit odds (30 days)0.5%top 60.0% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri’s CRuby native extension could leave a Ruby wrapper pointing to freed memory when replacing the value of an XML attribute. If Ruby code had already accessed an attribute child node, Nokogiri::XML::Attr#value= could free the underlying native child node while the wrapper remained reachable through the document node cache. A later use of the freed child node or a Ruby GC mark could dereference an invalid pointer, causing an invalid read and a possible segfault. This vulnerability is fixed in 1.19.4.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12ruby-nokogirino fix listedDEBIAN-CVE-2026-57435
Debian:13ruby-nokogirino fix listedDEBIAN-CVE-2026-57435
Debian:14ruby-nokogiri1.19.4+dfsg-1DEBIAN-CVE-2026-57435
RubyGemsnokogiri1.19.4GHSA-phwj-rprq-35pp
Ubuntu:24.04:LTSruby-nokogirino fix listedUBUNTU-CVE-2026-57435
Ubuntu:25.10ruby-nokogirino fix listedUBUNTU-CVE-2026-57435
Ubuntu:26.04:LTSruby-nokogirino fix listedUBUNTU-CVE-2026-57435
Ubuntu:26.10ruby-nokogirino fix listedUBUNTU-CVE-2026-57435

Affected products (as reported)

VendorProductVersions
sparklemotion nokogiri < 1.19.4

Weakness: CWE-416, CWE-825 · Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U

References