Skip to content
5.9 Medium

CVE-2025-4516 There is an issue in CPython when using `bytes.decode("unicode_escape", error="ignore|replace")`

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 and versions

Product Affected versions Fixed in
CPython 3.14 3.14.0a1 → < 3.14.0b2 3.14.0b2
CPython 3.13 3.13.0 → < 3.13.4 3.13.4
CPython 3.12 3.12.0 → < 3.12.11 3.12.11
CPython 3.11 3.11.0 → < 3.11.13 3.11.13
CPython 3.10 3.10.0 → < 3.10.18 3.10.18
CPython 3.9 earliest → < 3.9.23 3.9.23

References

Timeline

  1. Published
  2. Last modified
The 79 CVEs of CPython →
Track this CVE