{"id":"CVE-2026-57436","published":"2026-06-25T14:33:29Z","modified":"2026-06-25T23:27:34Z","title":"Nokogiri: Possible Use-After-Free when setting `Document#root=` to an invalid node type","vendor":"sparklemotion","product":"nokogiri","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":1.7,"severity":"LOW","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00402,"percentile":0.3534,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-wjv4-x9w8-wm3h","tags":["x_refsource_CONFIRM"]}],"priority":{"score":8.3,"factors":[{"name":"EPSS percentile","points":7.07},{"name":"CVSS severity","points":1.19}]},"vendorSlug":"sparklemotion","affectedVersions":[{"vendor":"sparklemotion","product":"nokogiri","versions":["< 1.19.4"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-06-25T23:26:42.649086Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-39427","exploited":false,"provenance":"source"}}