{"id":"CVE-2024-58378","summary":"Nokogiri before 1.16.2 Use-After-Free via xmlTextReader","details":"Nokogiri before 1.15.6 and 1.16.x before 1.16.2 (CRuby, when using the packaged libxml2) is affected by a use-after-free vulnerability in libxml2 (CVE-2024-25062) in the xmlTextReader module, which underlies Nokogiri::XML::Reader. When using the XML Reader interface with DTD validation and XInclude expansion enabled, processing a crafted XML document can lead to an xmlValidatePopElement use-after-free. Nokogiri 1.15.6 and 1.16.2 resolve this by upgrading the packaged libxml2 to 2.11.7 and 2.12.5 respectively. JRuby and installations using system libxml2 are not affected.","aliases":["GHSA-xc9x-jj77-9p9j"],"modified":"2026-08-29T03:45:12.719178560Z","published":"2026-08-25T15:15:57.242Z","database_specific":{"cwe_ids":["CWE-416"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/58xxx/CVE-2024-58378.json","cna_assigner":"VulnCheck"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/58xxx/CVE-2024-58378.json"},{"type":"ADVISORY","url":"https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xc9x-jj77-9p9j"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58378"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/nokogiri-before-use-after-free-via-xmltextreader"},{"type":"FIX","url":"https://github.com/GNOME/libxml2/commit/92721970"},{"type":"FIX","url":"https://github.com/sparklemotion/nokogiri/commit/92721970"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/sparklemotion/nokogiri","events":[{"introduced":"34571990eaac1c95a3dea31fd8f31b6baa18df47"},{"fixed":"673756fdd69d1036874b7d7250cc38a51fd4d7b8"},{"introduced":"0"},{"fixed":"7ab63106edb578880c3436c0cc9597e271b5dfcd"}],"database_specific":{"extracted_events":[{"introduced":"1.16.0"},{"fixed":"1.16.2"},{"introduced":"0"},{"fixed":"1.15.6"}],"source":"AFFECTED_FIELD"}}],"versions":["v1.15.5","v1.16.1","v1.16.0","v1.15.4","v1.15.3","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-2024-58378.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]}