CVE-2025-4516 | Use-after-free in "unicode_escape" decoder with error handler

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.

Published: 2025-05-15 Last update: 2026-04-15 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2025-4516 is rated Low Risk (38.8/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.21%). Mandatory action: Monitor for updates and reassess as exploit intelligence or EPSS changes.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Exploit prediction scoring system (EPSS) score for CVE-2025-4516

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-03-11 0.06% 0.21% +0.15%
2 2026-02-18 0.01% 0.06% +0.05%
3 2025-05-16 0.01%

Full EPSS history (3 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2025-4516

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
5.9 4.0 MEDIUM
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Click to expand
Attack vector (AV:L)
Attacker needs local access on the target system.
Attack complexity (AC:H)
Exploitation depends on constrained or hard-to-reproduce conditions.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:H)
High availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Exploit maturity (threat) (E:X)
Not defined: no reliable threat intelligence; scoring assumes the worst case (equivalent to Attacked).
Confidentiality requirement (CR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Integrity requirement (IR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Availability requirement (AR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Modified attack vector (MAV:X)
Not defined: scoring uses the Base Attack Vector (AV).
Modified attack complexity (MAC:X)
Not defined: scoring uses the Base Attack Complexity (AC).
Modified attack requirements (MAT:X)
Not defined: scoring uses the Base Attack Requirements (AT).
Modified privileges required (MPR:X)
Not defined: scoring uses the Base Privileges Required (PR).
Modified user interaction (MUI:X)
Not defined: scoring uses the Base User Interaction (UI).
Modified vulnerable system confidentiality impact (MVC:X)
Not defined: scoring uses the Base VC metric.
Modified vulnerable system integrity impact (MVI:X)
Not defined: scoring uses the Base VI metric.
Modified vulnerable system availability impact (MVA:X)
Not defined: scoring uses the Base VA metric.
Modified subsequent system confidentiality impact (MSC:X)
Not defined: scoring uses the Base SC metric.
Modified subsequent system integrity impact (MSI:X)
Not defined: scoring uses the Base SI metric.
Modified subsequent system availability impact (MSA:X)
Not defined: scoring uses the Base SA metric.
Safety (supplemental) (S:X)
Not evaluated.
Automatable (supplemental) (AU:X)
Not evaluated.
Recovery (supplemental) (R:X)
Not evaluated.
Value density (supplemental) (V:X)
Not evaluated.
Vulnerability response effort (supplemental) (RE:X)
Not evaluated.
Provider urgency (supplemental) (U:X)
Not evaluated.
[email protected]

Weakness enumeration for CVE-2025-4516

OS Trackers for CVE-2025-4516

vendor priority summary link
alpine CVE-2025-4516: 1 source package rows (python3); 6 state rows across 6 repos (3.18-main, 3.19-main, 3.20-main, 3.21-main, 3.22-main, edge-main); fixed 6, open 0. https://security.alpinelinux.org/vuln/CVE-2025-4516
debian unimportant CVE-2025-4516 unimportant priority: Debian including 4 source packages (pypy3, python3.11, python3.13, python3.9), 10 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): resolved 10. https://security-tracker.debian.org/tracker/CVE-2025-4516
gentoo high CVE-2025-4516: 1 GLSA(s) (202506-07), 2 atom(s) (dev-lang/pypy, dev-lang/python); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2025-4516
redhat medium https://access.redhat.com/security/cve/CVE-2025-4516
suse medium CVE-2025-4516 severity moderate: SUSE including 573 source package names (0.0.17-1.1:libpython3_11-1_0-3.11.13-150600.3.30.1, 0.0.17-1.1:libpython3_6m1_0-3.6.15-150300.10.97.1, …), 2301 product×package rows across 356 product lines (Container bci/kiwi, Container bci/spack, … (356 product lines)): Fixed 2010, Known Affected 226, Will Not Fix 65. https://www.suse.com/security/cve/CVE-2025-4516/
ubuntu medium CVE-2025-4516 medium priority: Ubuntu including 12 source packages (python2.7, python3.10, …), 93 status rows across 10 suites (bionic, focal, jammy, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 60, released 13, not-affected 12, needs-triage 7, ignored 1. https://ubuntu.com/security/CVE-2025-4516

Affected software / configurations for CVE-2025-4516

Vendor Product Version Raw CPE
No affected products in dataset.

References for CVE-2025-4516

URL Tags
https://github.com/python/cpython/commit/4398b788ffc1f954a2c552da285477d42a571292
https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d
https://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142
https://github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431f
https://github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77
https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e
https://github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598b
https://github.com/python/cpython/issues/133767
https://github.com/python/cpython/pull/129648
https://mail.python.org/archives/list/[email protected]/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/
http://www.openwall.com/lists/oss-security/2025/05/16/4
http://www.openwall.com/lists/oss-security/2025/05/19/1
cvelogic Threat Intelligence