CVE-2025-4516

NameCVE-2025-4516
DescriptionThere 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.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
python3.11 (PTS)bookworm3.11.2-6+deb12u6vulnerable
bookworm (security)3.11.2-6+deb12u3vulnerable
python3.12 (PTS)sid3.12.10-1vulnerable
python3.13 (PTS)trixie3.13.3-2vulnerable
sid3.13.5-2fixed
python3.9 (PTS)bullseye3.9.2-1vulnerable
bullseye (security)3.9.2-1+deb11u3vulnerable

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
python3.11source(unstable)(unfixed)
python3.12source(unstable)(unfixed)
python3.13source(unstable)3.13.3-4
python3.9source(unstable)(unfixed)

Notes

[bookworm] - python3.11 <no-dsa> (Minor issue)
[bullseye] - python3.9 <postponed> (Minor issue, likely DoS-only, fix along with next update)
https://mail.python.org/archives/list/security-announce@python.org/thread/L75IPBBTSCYEF56I2M4KIW353BB3AY74/
PoC: https://www.openwall.com/lists/oss-security/2025/05/19/1
https://github.com/python/cpython/issues/133767
https://github.com/python/cpython/pull/129648
https://github.com/python/cpython/commit/9f69a58623bd01349a18ba0c7a9cb1dad6a51e8e (main)
https://github.com/python/cpython/commit/69b4387f78f413e8c47572a85b3478c47eba8142 (v3.14.0b2)
https://github.com/python/cpython/commit/6279eb8c076d89d3739a6edb393e43c7929b429d (v3.13.4)

Search for package or bug name: Reporting problems