What’s Vulnerable › Vulnerabilities

CVE-2025-4516: 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.

Affected products

How to fix

Upgrade to a fixed version: Python 3.10.18, 3.11.13, 3.12.11, 3.13.4. Check the vendor advisory for mitigations.

References

Get alerted when CVE-2025-4516 or the next vulnerability affects your stack