CVE-2025-4516 Use-after-free in "unicode_escape" decoder with error handler
MediumCVSS 5.9
EPSS 0.22%
- Published
- Updated
- Exploit status
- No public exploit known
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.
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| cbl-mariner python3(CBL-Mariner:2.0) | < 3.9.19-14 | 3.9.19-14 |
| azure linux python3(Azure Linux:3.0) | < 3.12.9-2 | 3.12.9-2 |
| debian/python3.11(Debian:12) | < 3.11.2-6+deb12u7 | 3.11.2-6+deb12u7 |
| debian/python3.11(Debian:12) | = 3.11.2-6 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u1 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u2 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u3 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u4 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u5 | No fix listed |
| debian/python3.11(Debian:12) | = 3.11.2-6+deb12u6 | No fix listed |
| debian/python3.13(Debian:13) | < 3.13.3-4 | 3.13.3-4 |
| Python Software Foundation CPython | < 3.9.23 | 3.9.23 |
| Python Software Foundation CPython | >= 3.10.0, < 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 |
| ubuntu/python3.10(Ubuntu:22.04) | < 3.10.12-1~22.04.10 | 3.10.12-1~22.04.10 |
| ubuntu/python3.11(Ubuntu:22.04) | < 3.11.0~rc1-1~22.04.1~esm4 | 3.11.0~rc1-1~22.04.1~esm4 |
| alpine/python3(Alpine:v3.18) | < 3.11.12-r1 | 3.11.12-r1 |
| alpine/python3(Alpine:v3.19) | < 3.11.12-r1 | 3.11.12-r1 |
| alpine/python3(Alpine:v3.20) | < 3.12.10-r1 | 3.12.10-r1 |
| alpine/python3(Alpine:v3.21) | < 3.12.10-r1 | 3.12.10-r1 |
| alpine/python3(Alpine:v3.22) | < 3.12.10-r1 | 3.12.10-r1 |
| alpine/python3(Alpine:v3.23) | < 3.12.10-r1 | 3.12.10-r1 |
Show 3 more
| Product | Affected versions | Fixed in |
|---|---|---|
| alpine/python3(Alpine:v3.24) | < 3.12.10-r1 | 3.12.10-r1 |
| ubuntu/python3.12(Ubuntu:24.04) | < 3.12.3-1ubuntu0.6 | 3.12.3-1ubuntu0.6 |
| ubuntu/python3.14(Ubuntu:26.04) | < 3.14.0-1 | 3.14.0-1 |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-4516 vendor-advisory
- github.com issue-tracking
- github.com patch
- mail.python.org vendor-advisory
- github.com patch
- github.com patch
- github.com patch
- github.com patch
- github.com patch
- github.com patch
- github.com patch
- www.openwall.com
- www.openwall.com
- Ubuntu CVE tracker vendor-advisory
- USN-7570-1 vendor-advisory
- www.cve.org
- security.alpinelinux.org vendor-advisory