CVE-2025-4516: Use-after-free in "unicode_escape" decoder with error handler
Noroxi assessment
Priority: Monitor (action score 23/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.22% (FIRST EPSS).
- Someone with local access to the system can trigger it. No account or password is required. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: Python Software Foundation CPython 3.10.18, 3.11.13, 3.12.11; azl3 python3 3.12.9-2 on Azure Linux 3.0 3.12.9-2; cbl2 python3 3.9.19-13 on CBL Mariner 2.0 3.9.19-14.
Low priority for now. Upgrade to Python Software Foundation CPython 3.10.18, 3.11.13, 3.12.11; azl3 python3 3.12.9-2 on Azure Linux 3.0 3.12.9-2; cbl2 python3 3.9.19-13 on CBL Mariner 2.0 3.9.19-14 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- BDU:2025-10930
- ALSA-2025:23530
- DLA-4445-1
- openSUSE-SU-2025:15141-1
- openSUSE-SU-2025:15154-1
- openSUSE-SU-2025:15163-1
- openSUSE-SU-2025:15190-1
- openSUSE-SU-2025:15191-1
- openSUSE-SU-2025:15192-1
- RHSA-2025:23530
- RLSA-2025:23530
- SUSE-SU-2025:01877-1
- SUSE-SU-2025:02038-1
- SUSE-SU-2025:02047-1
- SUSE-SU-2025:02048-1
- SUSE-SU-2025:02049-1
- SUSE-SU-2025:02050-1
- SUSE-SU-2025:02057-1
- SUSE-SU-2025:02074-1
- SUSE-SU-2025:02297-1
- Published
- May 15, 2025
- Updated
- Jul 31, 2026
- EPSS
- 0.2% · 13th percentile
- CWE
- CWE-416
Report tools
Action score
23
Low priority for now.
- CVSS
- 23 / 40 · 5.9 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- —
- CNA · PSF
- 5.9
- NVD has not scored this yet; the score shown is the CNA’s.
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
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
—
Versions reported by the vendor
Affected version ranges reported by the assigning authority (PSF). Independent of NVD's CPE analysis and usually ahead of it.
Python Software Foundation CPython
- before 3.9.23affected · python
- 3.10.0 and later · before 3.10.18affected · python
- 3.11.0 and later · before 3.11.13affected · python
- 3.12.0 and later · before 3.12.11affected · python
- 3.13.0 and later · before 3.13.4affected · python
- 3.14.0a1 and later · before 3.14.0b2affected · python
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | python39 | before 3.9.25-2.module_el8.10.0+4083+53cad1fb | 3.9.25-2.module_el8.10.0+4083+53cad1fb |
| AlmaLinux:8 | python39-attrs | before 20.3.0-2.module_el8.6.0+2780+a40f65e1 | 20.3.0-2.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-cffi | before 1.14.3-2.module_el8.6.0+2780+a40f65e1 | 1.14.3-2.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-cffi | before 1.14.3-2.module_el8.6.0+3248+c431e88c | 1.14.3-2.module_el8.6.0+3248+c431e88c |
| AlmaLinux:8 | python39-chardet | before 3.0.4-19.module_el8.6.0+2780+a40f65e1 | 3.0.4-19.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-cryptography | before 3.3.1-3.module_el8.10.0+3765+2f9a457d | 3.3.1-3.module_el8.10.0+3765+2f9a457d |
| AlmaLinux:8 | python39-Cython | before 0.29.21-5.module_el8.6.0+3248+c431e88c | 0.29.21-5.module_el8.6.0+3248+c431e88c |
| AlmaLinux:8 | python39-Cython | before 0.29.21-5.module_el8.6.0+2780+a40f65e1 | 0.29.21-5.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-debug | before 3.9.25-2.module_el8.10.0+4083+53cad1fb | 3.9.25-2.module_el8.10.0+4083+53cad1fb |
| AlmaLinux:8 | python39-devel | before 3.9.25-2.module_el8.10.0+4083+53cad1fb | 3.9.25-2.module_el8.10.0+4083+53cad1fb |
| AlmaLinux:8 | python39-idle | before 3.9.25-2.module_el8.10.0+4083+53cad1fb | 3.9.25-2.module_el8.10.0+4083+53cad1fb |
| AlmaLinux:8 | python39-idna | before 2.10-4.module_el8.10.0+3849+a48d89aa | 2.10-4.module_el8.10.0+3849+a48d89aa |
| AlmaLinux:8 | python39-iniconfig | before 1.1.1-2.module_el8.6.0+2780+a40f65e1 | 1.1.1-2.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-libs | before 3.9.25-2.module_el8.10.0+4083+53cad1fb | 3.9.25-2.module_el8.10.0+4083+53cad1fb |
| AlmaLinux:8 | python39-lxml | before 4.6.5-1.module_el8.6.0+2780+a40f65e1 | 4.6.5-1.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-lxml | before 4.6.5-1.module_el8.6.0+3248+c431e88c | 4.6.5-1.module_el8.6.0+3248+c431e88c |
| AlmaLinux:8 | python39-mod_wsgi | before 4.7.1-7.module_el8.10.0+3989+a618fe15.1 | 4.7.1-7.module_el8.10.0+3989+a618fe15.1 |
| AlmaLinux:8 | python39-more-itertools | before 8.5.0-2.module_el8.6.0+2780+a40f65e1 | 8.5.0-2.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-numpy | before 1.19.4-3.module_el8.6.0+2780+a40f65e1 | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-numpy | before 1.19.4-3.module_el8.6.0+3248+c431e88c | 1.19.4-3.module_el8.6.0+3248+c431e88c |
| AlmaLinux:8 | python39-numpy-doc | before 1.19.4-3.module_el8.6.0+2780+a40f65e1 | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-numpy-f2py | before 1.19.4-3.module_el8.6.0+3248+c431e88c | 1.19.4-3.module_el8.6.0+3248+c431e88c |
| AlmaLinux:8 | python39-numpy-f2py | before 1.19.4-3.module_el8.6.0+2780+a40f65e1 | 1.19.4-3.module_el8.6.0+2780+a40f65e1 |
| AlmaLinux:8 | python39-packaging | before 20.4-4.module_el8.6.0+2780+a40f65e1 | 20.4-4.module_el8.6.0+2780+a40f65e1 |
+96
Same product
python software foundation: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-115557Distrust compromised intermediate certificates in ssl module37Monitor
- CVE-2025-4517Arbitrary writes via tarfile realpath overflow37Monitor
- CVE-2026-19445Use-after-free of a server-side SSLContext when sni_callback switches contexts36Monitor
Published before and after this one in the same product
- ← EarlierCVE-2024-3220Feb 14, 2025 · Default mimetype known files writeable on Windows9Monitor
- ← EarlierCVE-2025-1795Feb 28, 2025 · Mishandling of comma during folding and unicode-encoding of email headers9Monitor
- Later →CVE-2024-12718Jun 3, 2025 · Bypass extraction filter to modify file metadata outside extraction directory21Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Python Software Foundation CPython | 3.10.18 | Vendor (CNA) |
| Python Software Foundation CPython | 3.11.13 | Vendor (CNA) |
| Python Software Foundation CPython | 3.12.11 | Vendor (CNA) |
| Python Software Foundation CPython | 3.13.4 | Vendor (CNA) |
| Python Software Foundation CPython | 3.14.0b2 | Vendor (CNA) |
| Python Software Foundation CPython | 3.9.23 | Vendor (CNA) |
| azl3 python3 3.12.9-2 on Azure Linux 3.0 | 3.12.9-2 · CBL-Mariner Releases | Microsoft (MSRC) |
| cbl2 python3 3.9.19-13 on CBL Mariner 2.0 | 3.9.19-14 · CBL-Mariner Releases | Microsoft (MSRC) |
| cbl2 python3 3.9.19-13 on CBL-Mariner 2.0 | 3.9.19-14 · CBL-Mariner Releases | Microsoft (MSRC) |
| cbl2 python3 3.9.19-14 on CBL Mariner 2.0 | 3.9.19-14 · CBL-Mariner Releases | Microsoft (MSRC) |
| almalinux:python39 | 3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-attrs | 20.3.0-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-cffi | 1.14.3-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-chardet | 3.0.4-19.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-cryptography | 3.3.1-3.module_el8.10.0+3765+2f9a457d · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-Cython | 0.29.21-5.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-debug | 3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-devel | 3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-idle | 3.9.25-2.module_el8.10.0+4083+53cad1fb · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-idna | 2.10-4.module_el8.10.0+3849+a48d89aa · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-iniconfig | 1.1.1-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python39-PyMySQL | 0.10.1-2.module_el8.6.0+2780+a40f65e1 · AlmaLinux:8 | Package registry (OSV) |
| alpine:python3 | 3.11.12-r1 · Alpine:v3.18 | Package registry (OSV) |
| debian:python3.11 | 3.11.2-6+deb12u7 · Debian:12 | Package registry (OSV) |
| debian:python3.13 | 3.13.3-4 · Debian:13 | Package registry (OSV) |
| debian:python3.9 | 3.9.2-1+deb11u4 · Debian:11 | Package registry (OSV) |
| opensuse:python310 | 3.10.18-150400.4.82.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:python310-core | 3.10.18-150400.4.82.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:python310-documentation | 3.10.18-150400.4.82.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
| opensuse:python311 | 3.11.13-150600.3.30.1 · openSUSE:Leap 15.6 | Package registry (OSV) |
+44
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
- CVE-2026-6100333 days apartUse-after-free in lzma.LZMADecompressor, bz2.BZ2Decompressor, and gzip.GzipFile after re-use under memory pressure36Monitor
- CVE-2026-19445503 days apartUse-after-free of a server-side SSLContext when sni_callback switches contexts36Monitor
Not on record for this CVE: EPSS history · researcher credit · public bounty program.
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- No account or password is required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- Integrity
- Availability
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- X
Weakness class (CWE)
CWE-416 · Use After FreeCVSS 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/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
nvd-secondary
Root cause
After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.
The bug in code
The whole CWE-416 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
free(dev->buf);
/* ... another thread is still running ... */
process(dev->buf);Fixed
lock(&dev->lock);
free(dev->buf);
dev->buf = NULL;
unlock(&dev->lock);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (11 more)Show less
- github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d
- github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142
- github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431f
- github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77
- github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e
- github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598b
- github.com/python/cpython/issues/133767
- github.com/python/cpython/pull/129648
- mail.python.org/archives/list/security-announce@python.org/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/
- www.openwall.com/lists/oss-security/2025/05/16/4
- www.openwall.com/lists/oss-security/2025/05/19/1
Vendor advisories and official records. Exploit/PoC links are deliberately left out.