CVE-2025-4516
published 2025-05-15CVE-2025-4516: 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…
PriorityP422medium5.9CVSS 4.0
AVLACHATPPRNUINVCNVINVAHSCNSINSANEXCRXIRXARXMAVXMACXMATXMPRXMUIXMVCXMVIXMVAXMSCXMSIXMSAXSXAUXRXVXREXUX
EPSS
0.18%
7.4th percentile
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.
Affected
13 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | pypy3 | < python3.13 3.13.3-4 (forky) | python3.13 3.13.3-4 (forky) |
| debian | python3.11 | < python3.13 3.13.3-4 (forky) | python3.13 3.13.3-4 (forky) |
| debian | python3.13 | < python3.13 3.13.3-4 (forky) | python3.13 3.13.3-4 (forky) |
| debian | python3.9 | < python3.13 3.13.3-4 (forky) | python3.13 3.13.3-4 (forky) |
| msrc | azl3_python3_3.12.9-2_on_azure_linux_3.0 | — | — |
| msrc | azl3_tensorflow_2.16.1-9_on_azure_linux_3.0 | — | — |
| msrc | cbl2_python3_3.9.19-13_on_cbl_mariner_2.0 | — | — |
| msrc | cbl2_python3_3.9.19-14_on_cbl_mariner_2.0 | — | — |
| python_software_foundation | cpython | < 3.10.18 | 3.10.18 |
| python_software_foundation | cpython | >= 3.11.0 < 3.11.13 | 3.11.13 |
| python_software_foundation | cpython | >= 3.12.0 < 3.12.11 | 3.12.11 |
| python_software_foundation | cpython | >= 3.13.0 < 3.13.4 | 3.13.4 |
| python_software_foundation | cpython | >= 3.14.0a1 < 3.14.0b2 | 3.14.0b2 |
CVSS provenance
nvdv4.05.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
osv5.9MEDIUM
vendor_debian5.9LOW
vendor_msrc5.9MEDIUM
vendor_redhat5.9MEDIUM
vendor_ubuntu2.3LOW
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
python3.13, python3.12, python3.11, python3.10, python3.9, python3.8, python3.7, python3.6 vulnerabilities
osv·2025-06-16·CVSS 2.3
CVE-2025-4516 [LOW] python3.13, python3.12, python3.11, python3.10, python3.9, python3.8, python3.7, python3.6 vulnerabilities
python3.13, python3.12, python3.11, python3.10, python3.9, python3.8, python3.7, python3.6 vulnerabilities
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. (CVE-2025-4516)
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. (CVE-2025-1795)
OSV
CVE-2025-4516: There is an issue in CPython when using `bytes
osv·2025-05-15·CVSS 5.9
CVE-2025-4516 [MEDIUM] CVE-2025-4516: There is an issue in CPython when using `bytes
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.
GHSA
GHSA-j8r3-cghj-9jhg: There is an issue in CPython when using `bytes
ghsa_unreviewed·2025-05-15
CVE-2025-4516 [MEDIUM] CWE-416 GHSA-j8r3-cghj-9jhg: There is an issue in CPython when using `bytes
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.
Ubuntu
Python vulnerabilities
vendor_ubuntu·2025-06-16·CVSS 2.3
CVE-2025-1795 [LOW] Python vulnerabilities
Title: Python vulnerabilities
Summary: Python could be made to crash or expose sensitive information.
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. (CVE-2025-4516)
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. (CVE-2025-1795)
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
cpython: python: CPython DecodeError Handling Vulnerability
vendor_redhat·2025-05-15·CVSS 5.9
CVE-2025-4516 [MEDIUM] CWE-416 cpython: python: CPython DecodeError Handling Vulnerability
cpython: python: CPython DecodeError Handling Vulnerability
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.
A vulnerability has been identified in CPython's bytes.decode() function when used with the "unicode_escape" encoding and the "ignore" or "replace" error handling modes. This flaw can result in the incorrect decoding of byte strings. While this may not directly lead to traditional security breaches like data exfiltration, the resulting unexpected program behavior could introduce instability,
Microsoft
Use-after-free in "unicode_escape" decoder with error handler
vendor_msrc·2025-05-13·CVSS 5.9
CVE-2025-4516 [MEDIUM] CWE-416 Use-after-free in "unicode_escape" decoder with error handler
Use-after-free in "unicode_escape" decoder with error handler
FAQ: Is Azure Linux the only Microsoft product that includes this open-source library and is therefore potentially affected by this vulnerability?
One of the main benefits to our customers who choose to use the Azure Linux distro is the commitment to keep it up to date with the most recent and most secure versions of the open source libraries with which the distro is composed. Microsoft is committed to transparency in this work which is why we began publishing CSAF/VEX in October 2025. See this blog post for more information. If impact to additional products is identified, we will update the CVE to reflect this.
Mariner: Mariner
PSF: PSF
Customer Action Required: Yes
Remediation: CBL-Mariner Releases
Reference: https://lea
Debian
CVE-2025-4516: pypy3 - There is an issue in CPython when using `bytes.decode("unicode_escape", error="i...
vendor_debian·2025·CVSS 5.9
CVE-2025-4516 [MEDIUM] CVE-2025-4516: pypy3 - There is an issue in CPython when using `bytes.decode("unicode_escape", error="i...
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.
Scope: local
bookworm: resolved
bullseye: resolved
forky: resolved
sid: resolved
trixie: resolved
No detection rules found.
No public exploits indexed.
https://github.com/python/cpython/commit/4398b788ffc1f954a2c552da285477d42a571292https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429dhttps://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142https://github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431fhttps://github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8ehttps://github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598bhttps://github.com/python/cpython/issues/133767https://github.com/python/cpython/pull/129648https://mail.python.org/archives/list/[email protected]/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/http://www.openwall.com/lists/oss-security/2025/05/16/4http://www.openwall.com/lists/oss-security/2025/05/19/1
2025-05-15
Published