CVE-2025-4516: Use-after-free in "unicode_escape" decoder with error handler
Vulnerability summary
CVE-2025-4516 is a medium (CVSS 5.9) Use After Free vulnerability in python software foundation cpython. EPSS estimates a 0.22% chance of exploitation in the next 30 days, higher than 13.3% of scored vulnerabilities.
Not severe (CVSS 5.9, local access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 16 · Related 14Timeline
- 15-05-2025PublishedVulnerability first disclosed.
- 31-07-2026Last modifiedVulnerability information updated.
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 metrics
7 scores · 7 sources · 1 version- OSV · AlpineEcosystem advisory · calculated5.9MediumCVSS: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
- OSV · UbuntuEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- OSV · DebianEcosystem advisory · calculated5.9MediumCVSS: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
- OSV · WolfiEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- OSV · ChainguardEcosystem advisory · calculated5.9MediumCVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- NVDNIST5.9MediumCVSS: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
EPSS trend
Probability
0.22%
Chance of exploitation in the next 30 days
Percentile
13%
Versus all other CVEs
30-day change
Increase +0.01 pp
From 0.22% on 04-10-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
0 foundNo public exploits indexed.
Weaknesses
CWE · root causeAffected systems
Known conditions: local access, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Ubuntu8 products
- python3.10< 3.10.12-1~22.04.10
- python3.11< 3.11.0~rc1-1~22.04.1~esm4
- python3.12< 3.12.3-1ubuntu0.6
- python3.14< 3.14.0-1
- python3.6< 3.6.9-1~18.04ubuntu1.13+esm5
Opensuse6 products
- python310&distro=openSUSE Tumbleweed< 3.10.17-4.1
- python311&distro=openSUSE Tumbleweed< 3.11.12-4.1
- python312&distro=openSUSE Tumbleweed< 3.12.10-4.1
- python313&distro=openSUSE Tumbleweed< 3.13.3-3.1
- python314&distro=openSUSE Tumbleweed< 3.14.0~b1-3.1
Chainguard5 products
- python-3.10< 3.10.19-r0
- python-3.11< 3.11.14-r0
- python-3.12< 3.12.10-r2
- python-3.13< 3.13.3-r2
- python-3.9< 3.9.25-r0
Wolfi4 products
- python-3.10< 3.10.19-r0
- python-3.11< 3.11.14-r0
- python-3.12< 3.12.10-r2
- python-3.13< 3.13.3-r2
Debian2 products
- python3.11< 3.11.2-6+deb12u7
- python3.13< 3.13.3-4
Suse2 products
- python3-core&distro=SUSE Linux Enterprise Micro 5.1< 3.6.15-150000.3.176.1 | < 3.6.15-150000.3.179.1
- python3&distro=SUSE Linux Enterprise Micro 5.1< 3.6.15-150000.3.176.1 | < 3.6.15-150000.3.179.1
Alpine1 product
- python3< 3.11.12-r1 | < 3.12.10-r1
Python software foundation1 product
- cpython< 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.0b2
8 vendors · 29 products
References
33 links- mail.python.org/archives/list/security-announce@python.org/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/Vendor AdvisoryREPORTAdvisory
Show all 33 references
- github.com/python/cpythonPACKAGE
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory
- lists.opensuse.org/archives/…Advisory