// For flags

CVE-2025-4516

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

Severity Score

5.9
*CVSS v4

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Track
*SSVC
Descriptions

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.

It was discovered that Python incorrectly handled certain unicode characters during decoding. An attacker could possibly use this issue to cause a denial of service. It was discovered that Python incorrectly handled unicode encoding of email headers with list separators in folded lines. An attacker could possibly use this issue to expose sensitive information.

*Credits: N/A
CVSS Scores
Attack Vector
Local
Attack Complexity
High
Attack Requirements
Present
Privileges Required
None
User Interaction
None
System
Vulnerable | Subsequent
Confidentiality
None
None
Integrity
None
None
Availability
High
None
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None
Attack Vector
Network
Attack Complexity
Low
Authentication
None
Confidentiality
Partial
Integrity
Partial
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:Track
Exploitation
None
Automatable
No
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2025-05-09 CVE Reserved
  • 2025-05-15 CVE Published
  • 2025-06-03 CVE Updated
  • 2025-06-16 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-416: Use After Free
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Python Software Foundation
Search vendor "Python Software Foundation"
CPython
Search vendor "Python Software Foundation" for product "CPython"
< 3.9.23
Search vendor "Python Software Foundation" for product "CPython" and version " < 3.9.23"
en
Affected
Python Software Foundation
Search vendor "Python Software Foundation"
CPython
Search vendor "Python Software Foundation" for product "CPython"
>= 3.10.0 < 3.10.18
Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.10.0 < 3.10.18"
en
Affected
Python Software Foundation
Search vendor "Python Software Foundation"
CPython
Search vendor "Python Software Foundation" for product "CPython"
>= 3.11.0 < 3.11.13
Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.11.0 < 3.11.13"
en
Affected
Python Software Foundation
Search vendor "Python Software Foundation"
CPython
Search vendor "Python Software Foundation" for product "CPython"
>= 3.12.0 < 3.12.11
Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.12.0 < 3.12.11"
en
Affected
Python Software Foundation
Search vendor "Python Software Foundation"
CPython
Search vendor "Python Software Foundation" for product "CPython"
>= 3.13.0 < 3.13.4
Search vendor "Python Software Foundation" for product "CPython" and version " >= 3.13.0 < 3.13.4"
en
Affected