ADVISORIES

CVE Program

CNA-CVE-2025-4516

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

Details

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 packages

EcosystemPackageAffected versions
Pythonpython
All versions before 3.9.23 (fixed in 3.9.23)
From 3.10.0 before 3.10.18 (fixed in 3.10.18)
From 3.11.0 before 3.11.13 (fixed in 3.11.13)
From 3.12.0 before 3.12.11 (fixed in 3.12.11)
From 3.13.0 before 3.13.4 (fixed in 3.13.4)
From 3.14.0a1 before 3.14.0b2 (fixed in 3.14.0b2)

References