Use-after-free in "unicode_escape" decoder with error handler
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Attack requirements
- Present
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 2 fixed, 7 without a fix
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and Red Hat. Impact type from CWE-416 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Python Software Foundation | CPython | before 3.9.23; 3.10.0 to before 3.10.18; 3.11.0 to before 3.11.13; 3.12.0 to before 3.12.11; 3.13.0 to before 3.13.4; 3.14.0a1 to before 3.14.0b2 | 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, 3.14.0b2 | Patch available | CNA |
- CPython VendorPython Software Foundation Affected before 3.9.23; 3.10.0 to before 3.10.18; 3.11.0 to before 3.11.13; 3.12.0 to before 3.12.11; 3.13.0 to before 3.13.4; 3.14.0a1 to before 3.14.0b2 Fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, 3.14.0b2 Patch available CNA
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:python:python:*:*:*:*:*:*:*:* | — | — | python-pillow |
- cpe:2.3:a:python:python:*:*:*:*:*:*:*:* Versions — — ·python-pillow
Remediation
- Fix · CNA CPython (Python Software Foundation) Fixed in 3.9.23, 3.10.18, 3.11.13, 3.12.11, 3.13.4, 3.14.0b2
Red Hat 1 advisory
- RHSA-2025:23530 Released 2025-12-18 · Red Hat rating Importantpython39:3.9 security update
- Red Hat Enterprise Linux AppStream (v. 8) PyYAML-5.4.1-1.module+el8.9.0+19644+d68f775d.src::python39:3.9, mod_wsgi-4.7.1-7.module+el8.10.0+23075+0aa18782.1.src::python39:3.9, numpy-1.19.4-3.module+el8.9.0+19644+d68f775d.src::python39:3.9 +47
- Red Hat Enterprise Linux CRB (v. 8) Cython-0.29.21-5.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9, pybind11-2.7.1-1.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9, pytest-6.0.2-2.module+el8.9.0+19644+d68f775d.src::python39-devel:3.9 +33
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 10 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 8 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 9 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux AI (RHEL AI) | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift AI (RHOAI) | Affected | — |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2025:23530 |
| Red Hat Enterprise Linux CRB (v. 8) | Fixed | RHSA-2025:23530 |
Timeline
- 2026-10-02 Threatist record created from CVE-2025-4516
- 2026-10-03 Alias added: GHSA-j8r3-cghj-9jhg
- 2026-11-06 Affected versions changed · Red Hat
References
Patch 8
- https://github.com/python/cpython/pull/129648
- https://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142
- https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e
- https://github.com/python/cpython/commit/4398b788ffc1f954a2c552da285477d42a571292
- https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d
- https://github.com/python/cpython/commit/73b3040f592436385007918887b7e2132aa8431f
- https://github.com/python/cpython/commit/8d35fd1b34935221aff23a1ab69a429dd156be77
- https://github.com/python/cpython/commit/ab9893c40609935e0d40a6d2a7307ea51aec598b
Advisory 1
More Python Software Foundation vulnerabilities
- TI-2024-07037 Quadratic complexity parsing cookies with backslashes CVSS 3.1HIGH 7.5
- TI-2024-11791 Bypass extraction filter to modify file metadata outside extraction directory CVSS 3.1MEDIUM 5.3
- TI-2024-00411 Quoted zip-bomb protection for zipfile CVSS 3.1MEDIUM 6.2
- TI-2026-13296 `HTTPPasswordMgr` can send saved HTTPS credentials via HTTP because of incorrect scheme matching CVSS 4.0MEDIUM 6.0
- TI-2024-06422 Email header injection due to unquoted newlines CVSS 3.1MEDIUM 5.5
- TI-2026-04606 Possible to hijack modules in current working directory CVSS 4.0MEDIUM 5.6
Sources
- CVE-2025-4516 · CVE Program
- CVE-2025-4516 · NVD
- FIRST EPSS
- GHSA-j8r3-cghj-9jhg · GitHub Advisory Database · CC BY 4.0
- CVE-2025-4516 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences