This vulnerability was reported to MITRE without a report to the Python Security Response Team (security@python.org). Thanks to Samuel Henrique for reporting this vulnerability to the PSRT for a proper advisory to be published. Reports for vulnerabilities in Python should be sent to the PSRT to ensure an advisory is published properly.

Description

A use-after-free exists in Python through 3.9 via heappushpop in heapq.

Affected versions
* Pre-release versions of Python are not recommended for production use.

** Note that Python 3.7.17 and earlier will not be receiving an upstream
security fix due to being end-of-life
(https://devguide.python.org/versions) contact your distributor of Python for additional guidance.

Remediation and work-arounds
Patches are available for all supported feature, bugfix, and security branches of Python:
References
Credits