CVE-2025-4516Use After Free in Software Foundation Cpython

CWE-416Use After Free9 documents8 sources
Severity
5.9MEDIUMNVD
OSV2.3
EPSS
0.2%
top 56.58%
CISA KEV
Not in KEV
Exploit
No known exploits
Timeline
PublishedMay 15
Latest updateJun 16

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.

CVSS 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

Affected Packages1 packages

CVEListV5python_software_foundation/cpython3.10.03.10.18+5

🔴Vulnerability Details

4
OSV
python3.13, python3.12, python3.11, python3.10, python3.9, python3.8, python3.7, python3.6 vulnerabilities2025-06-16
OSV
CVE-2025-4516: There is an issue in CPython when using `bytes2025-05-15
CVEList
Use-after-free in "unicode_escape" decoder with error handler2025-05-15
GHSA
GHSA-j8r3-cghj-9jhg: There is an issue in CPython when using `bytes2025-05-15

📋Vendor Advisories

4
Ubuntu
Python vulnerabilities2025-06-16
Red Hat
cpython: python: CPython DecodeError Handling Vulnerability2025-05-15
Microsoft
Use-after-free in "unicode_escape" decoder with error handler2025-05-13
Debian
CVE-2025-4516: pypy3 - There is an issue in CPython when using `bytes.decode("unicode_escape", error="i...2025
CVE-2025-4516 — Use After Free | cvebase