CVE Catalog

CVE-2025-4516

MediumCVSS 5.9
Published: Updated: Translated: NVD NIST

Exploitation Probability (EPSS)

Low risk
0.18%

8th percentile - higher than 8% of all known CVEs

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, you are not affected. To work around, stop using the error= handler and wrap the bytes.decode() call in a try-except catching DecodeError.

Risk Assessment

Risk of unexpected behavior or potential error when decoding bytes with unicode_escape encoding and error handling.

Recommendation

Update CPython to a version containing the fix or apply the temporary workaround using try-except.

Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS