{"id":"CVE-2025-4516","state":"PUBLISHED","title":"Use-after-free in \"unicode_escape\" decoder with error handler","description":"There is an issue in CPython when using `bytes.decode(\"unicode_escape\", error=\"ignore|replace\")`. If you are not using the \"unicode_escape\" encoding or an error handler your usage is not affected. To work-around this issue you may stop using the error= handler and instead wrap the bytes.decode() call in a try-except catching the DecodeError.","publishedAt":"2025-05-15T13:29:20.126Z","updatedAt":"2026-07-31T14:02:21.178Z","severity":{"score":5.9,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","source":"PSF"},"assigner":"PSF","products":["Python Software Foundation CPython"],"affected":[{"vendor":"Python Software Foundation","product":"CPython","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"3.9.23","versionType":"python"},{"version":"3.10.0","status":"affected","lessThan":"3.10.18","versionType":"python"},{"version":"3.11.0","status":"affected","lessThan":"3.11.13","versionType":"python"},{"version":"3.12.0","status":"affected","lessThan":"3.12.11","versionType":"python"},{"version":"3.13.0","status":"affected","lessThan":"3.13.4","versionType":"python"},{"version":"3.14.0a1","status":"affected","lessThan":"3.14.0b2","versionType":"python"}],"repo":"https://github.com/python/cpython"}],"references":["https://github.com/python/cpython/issues/133767","https://github.com/python/cpython/pull/129648","https://mail.python.org/archives/list/security-announce@python.org/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/","https://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142","https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e","https://github.com/python/cpython/commit/4398b788ffc1f954a2c552da285477d42a571292","https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d","https://github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431f","https://github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77","https://github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598b","http://www.openwall.com/lists/oss-security/2025/05/16/4","http://www.openwall.com/lists/oss-security/2025/05/19/1"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:09:23.771Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/4xxx/CVE-2025-4516.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-4516","state":"PUBLISHED","datePublished":"2025-05-15T13:29:20.126Z","dateUpdated":"2026-07-31T14:02:21.178Z","assignerShortName":"PSF","assignerOrgId":"28c92f92-d60d-412d-b760-e73465c3df22","dateReserved":"2025-05-09T14:59:53.878Z"},"containers":{"cna":{"title":"Use-after-free in \"unicode_escape\" decoder with error handler","descriptions":[{"lang":"en","value":"There is an issue in CPython when using `bytes.decode(\"unicode_escape\", error=\"ignore|replace\")`. If you are not using the \"unicode_escape\" encoding or an error handler your usage is not affected. To work-around this issue you may stop using the error= handler and instead wrap the bytes.decode() call in a try-except catching the DecodeError."}],"affected":[{"vendor":"Python Software Foundation","product":"CPython","defaultStatus":"unaffected","versions":[{"version":"0","status":"affected","lessThan":"3.9.23","versionType":"python"},{"version":"3.10.0","status":"affected","lessThan":"3.10.18","versionType":"python"},{"version":"3.11.0","status":"affected","lessThan":"3.11.13","versionType":"python"},{"version":"3.12.0","status":"affected","lessThan":"3.12.11","versionType":"python"},{"version":"3.13.0","status":"affected","lessThan":"3.13.4","versionType":"python"},{"version":"3.14.0a1","status":"affected","lessThan":"3.14.0b2","versionType":"python"}],"repo":"https://github.com/python/cpython"}],"references":[{"url":"https://github.com/python/cpython/issues/133767","tags":["issue-tracking"]},{"url":"https://github.com/python/cpython/pull/129648","tags":["patch"]},{"url":"https://mail.python.org/archives/list/security-announce@python.org/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/","tags":["vendor-advisory"]},{"url":"https://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/4398b788ffc1f954a2c552da285477d42a571292","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431f","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77","tags":["patch"]},{"url":"https://github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598b","tags":["patch"]}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"HIGH","attackRequirements":"PRESENT","attackVector":"LOCAL","baseScore":5.9,"baseSeverity":"MEDIUM","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"NONE","subIntegrityImpact":"NONE","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","version":"4.0","vulnAvailabilityImpact":"HIGH","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"NONE","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","description":"CWE-416 Use After Free","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"PSF","orgId":"28c92f92-d60d-412d-b760-e73465c3df22","dateUpdated":"2026-07-31T14:02:21.178Z"},"source":{"discovery":"UNKNOWN"},"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2025-05-15T14:18:44.612125Z","id":"CVE-2025-4516","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-05-15T14:18:50.599Z"}},{"title":"CVE Program Container","references":[{"url":"http://www.openwall.com/lists/oss-security/2025/05/16/4"},{"url":"http://www.openwall.com/lists/oss-security/2025/05/19/1"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-05-19T10:03:31.542Z"}}]}}}