{"cve":"CVE-2026-57236","nvd":{"published":"2026-06-25T15:16:40.627","modified":"2026-10-25T23:10:00.167","status":"Analyzed","description":"Nokogiri is an open source XML and HTML library for the Ruby programming language. Prior to 1.19.4, calling Document#encoding= with an invalid encoding (e.g., a non-string, or a string containing a null byte) raises an exception, but only after freeing the document's current encoding string without replacing it. The document is left referencing freed memory, so the next call to Document#encoding reads invalid memory, which can cause a segfault or leak freed bytes into a Ruby String. Affects the CRuby (libxml2) implementation only; JRuby is not affected. This vulnerability is fixed in 1.19.4.","cvss_v4":{"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","score":1.7},"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H","score":8.2},"cwes":["CWE-416"],"references":["https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-5v8h-3h3q-446p"],"products":["nokogiri:nokogiri"],"source":"nvd","synced_at":"2026-10-25T23:44:33.281319194+00:00"},"epss":{"cve":"CVE-2026-57236","score":0.00426,"percentile":0.36627,"date":"2026-10-25"},"kev":null,"osv":[{"id":"GHSA-5v8h-3h3q-446p","url":"https://osv.dev/vulnerability/GHSA-5v8h-3h3q-446p","summary":"Nokogiri: Possible Use-After-Free when `Nokogiri::XML::Document#encoding=` raises an exception","modified":"2026-09-10T03:50:48.442454970Z","packages":[{"ecosystem":"RubyGems","name":"nokogiri","purl":"pkg:gem/nokogiri","ranges":["<1.19.4"],"fixed":["1.19.4"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}