{"id":"CVE-2026-126064","summary":"Nokogiri: Possible Use-After-Free when setting an attribute value via `Nokogiri::XML::Node#[]=` or `#lang=`","details":"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.","aliases":["GHSA-3w22-6jfg-527w"],"modified":"2026-11-14T07:04:10.191564312Z","published":"2026-11-10T20:17:13.658Z","database_specific":{"cwe_ids":["CWE-416"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-126064.json","cna_assigner":"GitHub_M"},"references":[{"type":"WEB","url":"https://github.com/sparklemotion/nokogiri/releases/tag/v1.19.5"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-126064.json"},{"type":"ADVISORY","url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-3w22-6jfg-527w"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126064"},{"type":"FIX","url":"https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425"},{"type":"FIX","url":"https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6f"},{"type":"FIX","url":"https://github.com/sparklemotion/nokogiri/pull/3752"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/sparklemotion/nokogiri","events":[{"introduced":"0"},{"fixed":"724ef475332fb7378111e8e30d14eda6cdf33b1e"},{"fixed":"b15b518db9fd15fd6b046f73d1439c282e5cc425"},{"fixed":"feaed3c8c9bd9d81d064d4ca09b16044cd705d6f"}],"database_specific":{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"0"},{"fixed":"1.19.5"}]},{"range":[{"fixed":"b15b518db9fd15fd6b046f73d1439c282e5cc425"}],"source":"REFERENCES_COMMIT"},{"source":"REFERENCES_COMMIT","range":[{"fixed":"feaed3c8c9bd9d81d064d4ca09b16044cd705d6f"}]},{"original_tag":"v1.19.5","range":[{"fixed":"724ef475332fb7378111e8e30d14eda6cdf33b1e"}],"source":"REFERENCES_TAG"}]}}],"versions":["v1.19.4","v1.19.3","v1.19.2","v1.19.1","v1.19.0","v1.18.10","v1.18.9","v1.18.8","v1.18.7","v1.18.6","v1.18.5","v1.18.4","v1.18.3","v1.18.2","v1.18.1","v1.18.0","v1.18.0.rc1","v1.17.0","v1.16.0","v1.16.0.rc1","v1.15.2","v1.15.1","v1.15.0","v1.14.1","v1.14.0","v1.14.0.rc1","v1.13.0","v1.12.3","v1.12.2","v1.12.1","v1.12.0","v1.12.0.rc1","v1.11.3","v1.11.2","v1.11.1","v1.11.0","v1.11.0.rc4","v1.11.0.rc3","v1.11.0.rc2","v1.11.0.rc1","v1.10.3","v1.10.2","v1.8.5","v1.10.1","v1.10.0","v1.10.0.rc1","v1.9.1","v1.9.0","v1.9.0.rc1","v1.8.4","v1.8.3","v1.8.2","v1.8.1","v1.8.0","v1.7.0.1","v1.7.0","v1.6.8","v1.6.8.rc3","v1.6.8.rc2","v1.6.8.rc1","v1.6.7.rc4","v1.6.6.2","v1.6.7.rc3","v1.6.7.rc2","v1.6.7.rc1","1.7.0.1-linux-binary1","v1.6.6.1","v1.6.6","v1.6.5","v1.6.4","v1.6.3.1","v1.6.3","v1.6.3.rc3","v1.6.3.rc2","v1.6.3.rc1","v1.6.2.1","v1.6.2","v1.6.2.rc3","v1.6.2.rc1","v1.6.2.beta.1","v1.6.0","v1.5.9","v1.6.0.rc1","v1.5.8","v1.5.7","v1.5.7.rc3","v1.5.7.rc2","v1.5.7.rc1","v1.5.6","v1.5.6.rc2","v1.5.5.rc2","v1.5.5.rc1","v1.5.4.rc3","v1.5.4.rc2","v1.5.4.rc1","v1.5.3","v1.5.3.rc6","v1.5.3.rc5","v1.5.3.rc4","v1.5.3.rc3","v1.5.3.rc1","v1.5.2","v1.5.1","v1.5.1.rc1","v1.5.0","v1.5.0.beta.3","v1.5.0.beta.4","REL_1.5.0.beta.2","REL_1.5.0.beta.1","REL_1.0.7","REL_1.0.6","REL_1.0.5","REL_1.0.4","REL_1.0.3","REL_1.0.2","REL_1.0.1","REL_1.0.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-126064.json","vanir_signatures":[{"id":"CVE-2026-126064-161c3256","signature_type":"Line","signature_version":"v1","source":"https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425","target":{"file":"ext/nokogiri/xml_node.c"},"deprecated":false,"digest":{"threshold":0.9,"line_hashes":["329116804269084993714489021959617534366","10665907067385703663769956586580978131","134812508711210885486693546584642620676","20381425423044050306088530296539562877","134457471830423655074210106858204748570","36622836451855736997213296444458671068","144430016764396361434705084872384104791","268988912638822679529523639856674935434","152603131634523544213294050063299712497","288233812579710320950924674263781405848","216169459123383918151124780625084715068","318247276293638755266200135834695563732","44746090123199660023167899881278503869","178687873462930808034311631644840893336","73714882832018562849262239387733878012","104913182953523345898786919903959146845","192864377878061541207209652257262730700","253091471589412960543448590145047417172","333216520998683375947889663117427627398","60271165438403892780290973390156821580","143156081696064787073732185231326375646","338458117370049184364170742554539055683","251980397564018939110382001322371392767","266186097641940771996228689057420141892","336740353573011585655824815735450722080","199290589813375123519241020941445210301"]}},{"target":{"file":"ext/nokogiri/xml_node.c"},"deprecated":false,"digest":{"line_hashes":["329116804269084993714489021959617534366","10665907067385703663769956586580978131","134812508711210885486693546584642620676","20381425423044050306088530296539562877","134457471830423655074210106858204748570","36622836451855736997213296444458671068","144430016764396361434705084872384104791","268988912638822679529523639856674935434","152603131634523544213294050063299712497","288233812579710320950924674263781405848","216169459123383918151124780625084715068","318247276293638755266200135834695563732","44746090123199660023167899881278503869","178687873462930808034311631644840893336","73714882832018562849262239387733878012","104913182953523345898786919903959146845","192864377878061541207209652257262730700","253091471589412960543448590145047417172","333216520998683375947889663117427627398","60271165438403892780290973390156821580","143156081696064787073732185231326375646","338458117370049184364170742554539055683","251980397564018939110382001322371392767","266186097641940771996228689057420141892","336740353573011585655824815735450722080","199290589813375123519241020941445210301"],"threshold":0.9},"id":"CVE-2026-126064-18700355","signature_type":"Line","signature_version":"v1","source":"https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6f"},{"digest":{"function_hash":"282653681586140266861005422985172242471","length":514},"id":"CVE-2026-126064-60d2a016","signature_type":"Function","signature_version":"v1","source":"https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425","target":{"file":"ext/nokogiri/xml_node.c","function":"set"},"deprecated":false},{"signature_version":"v1","source":"https://github.com/sparklemotion/nokogiri/commit/b15b518db9fd15fd6b046f73d1439c282e5cc425","target":{"file":"ext/nokogiri/xml_node.c","function":"set_lang"},"deprecated":false,"digest":{"function_hash":"155793928786924279792997164897199354965","length":196},"id":"CVE-2026-126064-9bcca1d6","signature_type":"Function"},{"source":"https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6f","target":{"function":"set_lang","file":"ext/nokogiri/xml_node.c"},"deprecated":false,"digest":{"function_hash":"155793928786924279792997164897199354965","length":196},"id":"CVE-2026-126064-9eaf49f3","signature_type":"Function","signature_version":"v1"},{"target":{"function":"set","file":"ext/nokogiri/xml_node.c"},"deprecated":false,"digest":{"function_hash":"282653681586140266861005422985172242471","length":514},"id":"CVE-2026-126064-c5a8f6d0","signature_type":"Function","signature_version":"v1","source":"https://github.com/sparklemotion/nokogiri/commit/feaed3c8c9bd9d81d064d4ca09b16044cd705d6f"}],"vanir_signatures_modified":"2026-11-14T07:04:10Z"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"}]}