{"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":"2025-10-09T01:01:25.261996Z","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":["2.5","3.2","v0.9.8","v0.9.9","v1.0.1","v1.0.2","v1.1","v1.1.1","v1.2","v1.2b1","v1.2b2","v1.2b3","v1.2b4","v1.3","v1.3b1","v1.4","v1.4b1","v1.4b2","v1.4b3","v1.5","v1.5.1","v1.5.2","v1.5.2a1","v1.5.2a2","v1.5.2b1","v1.5.2b2","v1.5.2c1","v1.5a1","v1.5a2","v1.5a3","v1.5a4","v1.5b1","v1.5b2","v1.6a1","v1.6a2","v2.0","v2.0b1","v2.0b2","v2.0c1","v2.1","v2.1a1","v2.1a2","v2.1b1","v2.1b2","v2.1c1","v2.1c2","v2.2a3","v2.3c1","v2.3c2","v2.4","v2.4a1","v2.4a2","v2.4a3","v2.4b1","v2.4b2","v2.4c1","v2.5","v2.5.1","v2.5.1c1","v2.5.2","v2.5.2c1","v2.5.3","v2.5.3c1","v2.5.4","v2.5.5","v2.5.5c1","v2.5.5c2","v2.5.6","v2.5.6c1","v2.5a0","v2.5a1","v2.5a2","v2.5b1","v2.5b2","v2.5b3","v2.5c1","v2.5c2","v2.6","v2.6.1","v2.6.2","v2.6.2c1","v2.6.3","v2.6.3rc1","v2.6.4","v2.6.4rc1","v2.6.4rc2","v2.6.5","v2.6.5rc1","v2.6.5rc2","v2.6.6","v2.6.6rc1","v2.6.6rc2","v2.6.7","v2.6.8","v2.6.8rc1","v2.6.8rc2","v2.6a1","v2.6a2","v2.6a3","v2.6b1","v2.6b2","v2.6b3","v2.6rc1","v2.6rc2","v2.7","v2.7.1","v2.7.1rc1","v2.7.2","v2.7.2rc1","v2.7.3","v2.7.3rc1","v2.7.3rc2","v2.7.4rc1","v2.7a1","v2.7a2","v2.7a3","v2.7a4","v2.7b1","v2.7b2","v2.7rc1","v2.7rc2","v3.0a1","v3.0a2","v3.0a3","v3.0a4","v3.0a5","v3.0b1","v3.0b2","v3.0b3","v3.0rc1","v3.0rc2","v3.0rc3","v3.1","v3.1.1","v3.1.1rc1","v3.1.2","v3.1.2rc1","v3.1.3","v3.1.3rc1","v3.1.4","v3.1.4rc1","v3.1.5","v3.1.5rc1","v3.1.5rc2","v3.1a1","v3.1a2","v3.1b1","v3.1rc1","v3.1rc2","v3.2","v3.2.1","v3.2.1b1","v3.2.1rc1","v3.2.1rc2","v3.2.2","v3.2.2rc1","v3.2.3","v3.2.3rc1","v3.2.3rc2","v3.2.4","v3.2.4rc1","v3.2.5","v3.2.6","v3.2.6rc1","v3.2a1","v3.2a2","v3.2a3","v3.2a4","v3.2b1","v3.2b2","v3.2rc1","v3.2rc2","v3.2rc3","v3.3.0","v3.3.0a1","v3.3.0a2","v3.3.0a3","v3.3.0a4","v3.3.0b1","v3.3.0b2","v3.3.0rc1","v3.3.0rc2","v3.3.0rc3","v3.3.1","v3.3.1rc1","v3.3.2","v3.3.3","v3.3.3rc1","v3.3.3rc2","v3.3.4","v3.3.4rc1","v3.3.5","v3.3.5rc1","v3.3.5rc2","v3.3.6","v3.3.6rc1","v3.4.0","v3.4.0a1","v3.4.0a2","v3.4.0a3","v3.4.0a4","v3.4.0b1","v3.4.0b2","v3.4.0b3","v3.4.0rc1","v3.4.0rc2","v3.4.0rc3","v3.4.1","v3.4.1rc1","v3.4.2","v3.4.2rc1","v3.4.3","v3.4.3rc1","v3.4.4","v3.4.4rc1","v3.4.5","v3.4.5rc1","v3.4.6","v3.4.6rc1","v3.5.0","v3.5.0a1","v3.5.0a2","v3.5.0a3","v3.5.0a4","v3.5.0b1","v3.5.0b2","v3.5.0b3","v3.5.0b4","v3.5.0rc1","v3.5.0rc2","v3.5.0rc3","v3.5.0rc4","v3.5.1","v3.5.1rc1","v3.5.2","v3.5.2rc1","v3.5.3","v3.5.3rc1","v3.6.0","v3.6.0a1","v3.6.0a2","v3.6.0a3","v3.6.0a4","v3.6.0b1","v3.6.0b2","v3.6.0b3","v3.6.0b4","v3.6.0rc1","v3.6.0rc2","v3.7.0a1","v3.7.0a2","v3.7.0a3","v3.7.0a4","v3.8.0a1","v3.8.0a2","v3.8.0a3","v3.8.0a4","v3.8.0b1","v3.9.0a1","v3.9.0a2"],"database_specific":{"source":"https://github.com/psf/advisory-database/blob/main/advisories/python/PSF-2023-11.json","vanir_signatures":[{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"_heapq_heappushpop_impl"},"signature_type":"Function","digest":{"length":710,"function_hash":"324955308901997629728889525270365667066"},"id":"PSF-2023-11-2405f23a","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-2f590d67","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"_heapq_heappushpop_impl"},"signature_type":"Function","digest":{"length":710,"function_hash":"324955308901997629728889525270365667066"},"id":"PSF-2023-11-50844008","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup"},"signature_type":"Function","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"id":"PSF-2023-11-5480b96c","deprecated":false},{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c"},"signature_type":"Line","digest":{"threshold":0.9,"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"]},"id":"PSF-2023-11-58974d6e","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-594a69e5","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup"},"signature_type":"Function","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"id":"PSF-2023-11-5afd1982","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c"},"signature_type":"Line","digest":{"threshold":0.9,"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"]},"id":"PSF-2023-11-75a35e60","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"},"signature_type":"Function","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"id":"PSF-2023-11-77c72060","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-80cb45a4","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup"},"signature_type":"Function","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"id":"PSF-2023-11-895d3ee9","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"},"signature_type":"Function","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"id":"PSF-2023-11-8fffa26c","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"},"signature_type":"Function","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"id":"PSF-2023-11-91053e64","deprecated":false},{"source":"https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c"},"signature_type":"Line","digest":{"threshold":0.9,"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"]},"id":"PSF-2023-11-99e03949","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-b3c033e8","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c"},"signature_type":"Line","digest":{"threshold":0.9,"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"]},"id":"PSF-2023-11-be439b30","deprecated":false},{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup_max"},"signature_type":"Function","digest":{"length":832,"function_hash":"309963009613668588589849589045883691133"},"id":"PSF-2023-11-c58f2b0c","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-cf85dcd2","deprecated":false},{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftup"},"signature_type":"Function","digest":{"length":832,"function_hash":"3280056374216036770571194715632168683"},"id":"PSF-2023-11-d792d594","deprecated":false},{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-dbf057bf","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"heappushpop"},"signature_type":"Function","digest":{"length":764,"function_hash":"276000613757119954559411687933578853581"},"id":"PSF-2023-11-e2637075","deprecated":false},{"source":"https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown_max"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-e7771184","deprecated":false},{"source":"https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"siftdown"},"signature_type":"Function","digest":{"length":760,"function_hash":"22231544886286396884258967265102905279"},"id":"PSF-2023-11-e94e7525","deprecated":false},{"source":"https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76","signature_version":"v1","target":{"file":"Modules/_heapqmodule.c","function":"heappushpop"},"signature_type":"Function","digest":{"length":764,"function_hash":"276000613757119954559411687933578853581"},"id":"PSF-2023-11-fc8bf670","deprecated":false}]}}],"schema_version":"1.7.3","credits":[{"name":"Samuel Henrique","type":"REPORTER"}]}