CVE Vulnerabilities

CVE-2025-4516

Use After Free

Published: May 15, 2025 | Modified: Jun 03, 2025
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
5.1 MODERATE
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Ubuntu
MEDIUM

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.

Weakness

The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory “belongs” to the code that operates on the new pointer.

Affected Software

Name Vendor Start Version End Version
Python2.7 Ubuntu focal *
Python3.10 Ubuntu jammy *
Python3.11 Ubuntu esm-apps/jammy *
Python3.11 Ubuntu jammy *
Python3.12 Ubuntu noble *
Python3.12 Ubuntu oracular *
Python3.13 Ubuntu oracular *
Python3.13 Ubuntu plucky *
Python3.13 Ubuntu upstream *
Python3.14 Ubuntu devel *
Python3.14 Ubuntu questing *
Python3.6 Ubuntu esm-infra/bionic *
Python3.7 Ubuntu esm-apps/bionic *
Python3.8 Ubuntu esm-apps/bionic *
Python3.8 Ubuntu esm-infra/focal *
Python3.8 Ubuntu focal *
Python3.9 Ubuntu esm-apps/focal *
Python3.9 Ubuntu focal *

Potential Mitigations

References