CVE-2025-4516

published 15 May 2025 · updated 16 Nov 2026

Use-after-free in "unicode_escape" decoder with error handler

5.9MediumCVSS 5.9EPSS 0%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in 3.9.23, 3.10.18, 3.11.13 and 3 more.

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

Vendors, products and packages with version ranges

VendorProductVersionsFixed
Python Software Foundation<3.9.23, >=3.10.0 <3.10.18, >=3.11.0 <3.11.13, >=3.12.0 <3.12.11, >=3.13.0 <3.13.4, >=3.14.0a1 <3.14.0b23.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, 3.14.0b2

Timeline

Every event on this vulnerability

Embed

A live severity badge for an advisory, README or ticket

CVE-2025-4516 severity on Zeptric[![CVE-2025-4516](https://zeptric.io/badge/cve/CVE-2025-4516.svg)](https://zeptric.io/cve/CVE-2025-4516)