{"id":"PSF-2023-11","summary":"Use-after-free in heappushpop() of heapq module","details":"A use-after-free exists in Python through 3.9 via heappushpop in heapq.","aliases":["BIT-libpython-2022-48560","BIT-python-2022-48560","BIT-python-min-2022-48560","CVE-2022-48560","GHSA-pvw5-cvp6-cv92"],"modified":"2026-05-18T23:10:09.459874Z","published":"2023-08-22T00:00:00Z","database_specific":{"cwe_ids":[]},"references":[{"type":"ADVISORY","url":"https://www.cve.org/CVERecord?id=CVE-2022-48560"},{"type":"REPORT","url":"https://bugs.python.org/issue39421"},{"type":"FIX","url":"https://github.com/python/cpython/pull/18118"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python/cpython","events":[{"introduced":"0"},{"fixed":"79f89e6e5a659846d1068e8b1bd8e491ccdef861"},{"fixed":"958064f8d2b84062b0582bbae911df8ccfc11fd6"},{"fixed":"993811ffe75c2573f97fb3fd1414b34609b8c8db"},{"fixed":"c563f409ea30bcb0623d785428c9257917371b76"}]}],"versions":["v3.9.0a2","v3.6.10","v3.6.10rc1","v3.7.6rc1","v3.8.0rc1","v3.6.9","v3.6.9rc1","v3.7.3rc1","v3.6.8","v3.7.2rc1","v3.6.8rc1","v3.7.0rc1","v3.6.6rc1","v3.7.0b5","v3.7.0b4","v3.7.0b3","v3.7.0b2","v3.7.0b1","v3.7.0a2","v3.6.2rc1","v3.6.0rc1","v3.6.0b4","v3.6.0b3","v3.6.0b1","v3.6.0a3","v3.5.0b1","v3.5.0a4","v3.5.0a3","v3.5.0a2","v3.5.0a1","v3.4.0b3","v3.4.0b2","v3.4.0b1","v3.4.0a4","v3.4.0a3","v3.4.0a2","v3.4.0a1","v3.3.0rc3","v3.3.0rc2","v3.3.0rc1","v3.3.0b2","v3.3.0b1","v3.3.0a4","v3.3.0a3","v3.3.0a2","v3.2rc3","v3.2rc2","v3.2rc1","v3.2b2","v3.2b1","v3.2a4","v3.2a3","v3.2a2","v3.2a1","v3.1","v3.1rc2","v3.1rc1","v3.1b1","v3.1a2","v3.1a1","v3.0rc3","v3.0rc2","v3.0rc1","v3.0b3","v3.0b2","v3.0b1","v3.0a5","v3.0a4","v3.0a3","v3.0a2","v3.0a1","v2.4","v2.4c1","v2.4b2","v2.4b1","v2.4a3","v2.4a2","v2.4a1","v2.3c2","v2.3c1","v2.2a3","v2.1","v2.1c2","v2.1c1","v2.1b2","v2.1b1","v2.1a2","v2.1a1","v2.0","v2.0c1","v2.0b2","v2.0b1","v1.6a2","v1.6a1","v1.5.2","v1.5.2c1","v1.5.2b2","v1.5.2b1","v1.5.2a2","v1.5.2a1","v1.5.1","v1.5","v1.5b2","v1.5b1","v1.5a4","v1.5a3","v1.5a2","v1.5a1","v1.4","v1.4b3","v1.4b2","v1.4b1","v1.3","v1.3b1","v1.2","v1.2b4","v1.2b3","v1.2b2","v1.2b1","v1.1.1","v1.1","v1.0.2","v1.0.1","v0.9.9","v0.9.8"],"database_specific":{"source":"https://github.com/psf/advisory-database/blob/main/advisories/python/PSF-2023-11.json","vanir_signatures":[{"id":"PSF-2023-11-2405f23a","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"length":710,"function_hash":"324955308901997629728889525270365667066"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"_heapq_heappushpop_impl"}},{"id":"PSF-2023-11-2f590d67","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"}},{"id":"PSF-2023-11-50844008","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"length":710,"function_hash":"324955308901997629728889525270365667066"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"_heapq_heappushpop_impl"}},{"id":"PSF-2023-11-5480b96c","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup"}},{"id":"PSF-2023-11-58974d6e","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"line_hashes":["197026239169528121864697451797842612421","245310237281355008292010313933120890113","266713561029981846971761294270554474936","318196095331159298820085355818353768973","307188005591867911814352015116154818180","164471021853879432685408510714492668097","41628812059987655521048142320068133357","148400443678205979728189664215441460832","29821765899295708463884660989520308452","228153497088052303621773466120426103651","266843825262058508649798526922853944961","140588105149154598894352851068781274885","59464876907302982571516389495008471733","74775578873597483626241822801118200794","257773495927052666337025082142558529651","275195414420610702025480568803024254488","197026239169528121864697451797842612421","108839239207267978185721521497658727036","40728676020098106388747717508576800982","247311709859079282342701067757106960884","56331515336896098150728144898105776350","164471021853879432685408510714492668097","79984687878173923445851658253290508346","121814225812470975313270680405721975421","140988819539847330350728794853116669392","2036122204803784767379804826640739479","210907741191342698581740523193256699262","140588105149154598894352851068781274885"],"threshold":0.9},"deprecated":false,"signature_version":"v1","signature_type":"Line","target":{"file":"Modules/_heapqmodule.c"}},{"id":"PSF-2023-11-594a69e5","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"}},{"id":"PSF-2023-11-5afd1982","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup"}},{"id":"PSF-2023-11-75a35e60","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"line_hashes":["197026239169528121864697451797842612421","245310237281355008292010313933120890113","266713561029981846971761294270554474936","318196095331159298820085355818353768973","307188005591867911814352015116154818180","164471021853879432685408510714492668097","41628812059987655521048142320068133357","148400443678205979728189664215441460832","29821765899295708463884660989520308452","228153497088052303621773466120426103651","266843825262058508649798526922853944961","140588105149154598894352851068781274885","59464876907302982571516389495008471733","74775578873597483626241822801118200794","257773495927052666337025082142558529651","275195414420610702025480568803024254488","197026239169528121864697451797842612421","108839239207267978185721521497658727036","40728676020098106388747717508576800982","247311709859079282342701067757106960884","56331515336896098150728144898105776350","164471021853879432685408510714492668097","79984687878173923445851658253290508346","121814225812470975313270680405721975421","140988819539847330350728794853116669392","2036122204803784767379804826640739479","210907741191342698581740523193256699262","140588105149154598894352851068781274885"],"threshold":0.9},"deprecated":false,"signature_version":"v1","signature_type":"Line","target":{"file":"Modules/_heapqmodule.c"}},{"id":"PSF-2023-11-77c72060","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"}},{"id":"PSF-2023-11-80cb45a4","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"}},{"id":"PSF-2023-11-895d3ee9","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup"}},{"id":"PSF-2023-11-8fffa26c","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"}},{"id":"PSF-2023-11-91053e64","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"}},{"id":"PSF-2023-11-99e03949","source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","digest":{"line_hashes":["197026239169528121864697451797842612421","245310237281355008292010313933120890113","266713561029981846971761294270554474936","318196095331159298820085355818353768973","307188005591867911814352015116154818180","164471021853879432685408510714492668097","41628812059987655521048142320068133357","148400443678205979728189664215441460832","29821765899295708463884660989520308452","228153497088052303621773466120426103651","266843825262058508649798526922853944961","140588105149154598894352851068781274885","59464876907302982571516389495008471733","74775578873597483626241822801118200794","257773495927052666337025082142558529651","275195414420610702025480568803024254488","197026239169528121864697451797842612421","108839239207267978185721521497658727036","40728676020098106388747717508576800982","247311709859079282342701067757106960884","56331515336896098150728144898105776350","164471021853879432685408510714492668097","79984687878173923445851658253290508346","121814225812470975313270680405721975421","140988819539847330350728794853116669392","2036122204803784767379804826640739479","210907741191342698581740523193256699262","140588105149154598894352851068781274885"],"threshold":0.9},"deprecated":false,"signature_version":"v1","signature_type":"Line","target":{"file":"Modules/_heapqmodule.c"}},{"id":"PSF-2023-11-b3c033e8","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"}},{"id":"PSF-2023-11-be439b30","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"line_hashes":["197026239169528121864697451797842612421","245310237281355008292010313933120890113","266713561029981846971761294270554474936","318196095331159298820085355818353768973","307188005591867911814352015116154818180","164471021853879432685408510714492668097","41628812059987655521048142320068133357","148400443678205979728189664215441460832","29821765899295708463884660989520308452","228153497088052303621773466120426103651","266843825262058508649798526922853944961","140588105149154598894352851068781274885","59464876907302982571516389495008471733","74775578873597483626241822801118200794","257773495927052666337025082142558529651","275195414420610702025480568803024254488","197026239169528121864697451797842612421","108839239207267978185721521497658727036","40728676020098106388747717508576800982","247311709859079282342701067757106960884","56331515336896098150728144898105776350","164471021853879432685408510714492668097","79984687878173923445851658253290508346","121814225812470975313270680405721975421","140988819539847330350728794853116669392","2036122204803784767379804826640739479","210907741191342698581740523193256699262","140588105149154598894352851068781274885"],"threshold":0.9},"deprecated":false,"signature_version":"v1","signature_type":"Line","target":{"file":"Modules/_heapqmodule.c"}},{"id":"PSF-2023-11-c58f2b0c","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"}},{"id":"PSF-2023-11-cf85dcd2","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"}},{"id":"PSF-2023-11-d792d594","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftup"}},{"id":"PSF-2023-11-dbf057bf","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"}},{"id":"PSF-2023-11-e2637075","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"length":764,"function_hash":"276000613757119954559411687933578853581"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"heappushpop"}},{"id":"PSF-2023-11-e7771184","source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"}},{"id":"PSF-2023-11-e94e7525","source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"}},{"id":"PSF-2023-11-fc8bf670","source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","digest":{"length":764,"function_hash":"276000613757119954559411687933578853581"},"deprecated":false,"signature_version":"v1","signature_type":"Function","target":{"file":"Modules/_heapqmodule.c","function":"heappushpop"}}],"vanir_signatures_modified":"2026-05-18T23:10:09Z"}}],"schema_version":"1.7.5","credits":[{"name":"Samuel Henrique","type":"REPORTER"}]}