CVE-2026-57436
MEDIUMNokogiri: Possible Use-After-Free when setting `Document#root=` to an invalid node type
Title source: cnaDescription
Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, Nokogiri::XML::Document#root= validated only that the new root was a Nokogiri::XML::Node, allowing a DTD node to be set as the document root. The result is a heap use-after-free during garbage collection or finalization, leading to an invalid memory read or potentially a segfault. This vulnerability is fixed in 1.19.4.
References (1)
Core 1
Core References
X_Refsource_Confirm x_refsource_confirm
https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-wjv4-x9w8-wm3h
Scores
CVSS v3
5.3
EPSS
0.0032
EPSS Percentile
24.6%
Attack Vector
NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
CISA SSVC
Vulnrichment
Exploitation
none
Automatable
yes
Technical Impact
total
Details
CWE
CWE-416
Status
published
Products (2)
nokogiri/nokogiri
< 1.19.4
sparklemotion/nokogiri
< 1.19.4
Published
Jun 25, 2026
Tracked Since
Jun 25, 2026