CVE-2025-4516

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

State
Published
Severity
5.9 Medium
Published
May 15, 2025
Updated
Jul 31, 2026
Reserved
May 9, 2025

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
4.05.9 MediumCVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NPSF

Weaknesses

Affected Products

ProductVersions
CPythonPython Software Foundation
  • before 3.9.23Affected
  • 3.10.0 to before 3.10.18Affected
  • 3.11.0 to before 3.11.13Affected
  • 3.12.0 to before 3.12.11Affected
  • 3.13.0 to before 3.13.4Affected
  • 3.14.0a1 to before 3.14.0b2Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.