PSF-2023-11

See a problem?
Import Source
https://github.com/psf/advisory-database/blob/main/advisories/python/PSF-2023-11.json
JSON Data
https://api.test.osv.dev/v1/vulns/PSF-2023-11
Aliases
Published
2023-08-22T00:00:00Z
Modified
2025-09-19T01:44:41.718009Z
Summary
Use-after-free in heappushpop() of heapq module
Details

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

Database specific
{
    "cwe_ids": []
}
References
Credits
    • Samuel Henrique - REPORTER

Affected packages

Git / github.com/python/cpython

Affected ranges

Type
GIT
Repo
https://github.com/python/cpython
Events

Affected versions

2.*

2.5

3.*

3.2

v0.*

v0.9.8
v0.9.9

v1.*

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.*

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.6a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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

{
    "vanir_signatures": [
        {
            "source": "https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db",
            "digest": {
                "length": 710.0,
                "function_hash": "324955308901997629728889525270365667066"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "_heapq_heappushpop_impl"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-2405f23a"
        },
        {
            "source": "https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-2f590d67"
        },
        {
            "source": "https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861",
            "digest": {
                "length": 710.0,
                "function_hash": "324955308901997629728889525270365667066"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "_heapq_heappushpop_impl"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-50844008"
        },
        {
            "source": "https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6",
            "digest": {
                "length": 832.0,
                "function_hash": "3280056374216036770571194715632168683"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-5480b96c"
        },
        {
            "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
            },
            "target": {
                "file": "Modules/_heapqmodule.c"
            },
            "signature_version": "v1",
            "signature_type": "Line",
            "deprecated": false,
            "id": "PSF-2023-11-58974d6e"
        },
        {
            "source": "https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-594a69e5"
        },
        {
            "source": "https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76",
            "digest": {
                "length": 832.0,
                "function_hash": "3280056374216036770571194715632168683"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-5afd1982"
        },
        {
            "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
            },
            "target": {
                "file": "Modules/_heapqmodule.c"
            },
            "signature_version": "v1",
            "signature_type": "Line",
            "deprecated": false,
            "id": "PSF-2023-11-75a35e60"
        },
        {
            "source": "https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6",
            "digest": {
                "length": 832.0,
                "function_hash": "309963009613668588589849589045883691133"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-77c72060"
        },
        {
            "source": "https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-80cb45a4"
        },
        {
            "source": "https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861",
            "digest": {
                "length": 832.0,
                "function_hash": "3280056374216036770571194715632168683"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-895d3ee9"
        },
        {
            "source": "https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76",
            "digest": {
                "length": 832.0,
                "function_hash": "309963009613668588589849589045883691133"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-8fffa26c"
        },
        {
            "source": "https://github.com/python/cpython/commit/79f89e6e5a659846d1068e8b1bd8e491ccdef861",
            "digest": {
                "length": 832.0,
                "function_hash": "309963009613668588589849589045883691133"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-91053e64"
        },
        {
            "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
            },
            "target": {
                "file": "Modules/_heapqmodule.c"
            },
            "signature_version": "v1",
            "signature_type": "Line",
            "deprecated": false,
            "id": "PSF-2023-11-99e03949"
        },
        {
            "source": "https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-b3c033e8"
        },
        {
            "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
            },
            "target": {
                "file": "Modules/_heapqmodule.c"
            },
            "signature_version": "v1",
            "signature_type": "Line",
            "deprecated": false,
            "id": "PSF-2023-11-be439b30"
        },
        {
            "source": "https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db",
            "digest": {
                "length": 832.0,
                "function_hash": "309963009613668588589849589045883691133"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-c58f2b0c"
        },
        {
            "source": "https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-cf85dcd2"
        },
        {
            "source": "https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db",
            "digest": {
                "length": 832.0,
                "function_hash": "3280056374216036770571194715632168683"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftup"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-d792d594"
        },
        {
            "source": "https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-dbf057bf"
        },
        {
            "source": "https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6",
            "digest": {
                "length": 764.0,
                "function_hash": "276000613757119954559411687933578853581"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "heappushpop"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-e2637075"
        },
        {
            "source": "https://github.com/python/cpython/commit/958064f8d2b84062b0582bbae911df8ccfc11fd6",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown_max"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-e7771184"
        },
        {
            "source": "https://github.com/python/cpython/commit/993811ffe75c2573f97fb3fd1414b34609b8c8db",
            "digest": {
                "length": 760.0,
                "function_hash": "22231544886286396884258967265102905279"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "siftdown"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-e94e7525"
        },
        {
            "source": "https://github.com/python/cpython/commit/c563f409ea30bcb0623d785428c9257917371b76",
            "digest": {
                "length": 764.0,
                "function_hash": "276000613757119954559411687933578853581"
            },
            "target": {
                "file": "Modules/_heapqmodule.c",
                "function": "heappushpop"
            },
            "signature_version": "v1",
            "signature_type": "Function",
            "deprecated": false,
            "id": "PSF-2023-11-fc8bf670"
        }
    ]
}