# CVE-2024-31580: PyTorch heap buffer overflow vulnerability

- Severity: Medium 4.0 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 14% of CVEs (2026-12-01)
- Published: 2024-04-17T00:00:00.000Z
- Modified: 2026-09-08T08:48:18.902Z
- Also known as: GHSA-5pcm-hx3q-hm94, BIT-PYTORCH-2024-31580, PYSEC-2024-252, PYSEC-2024-328
- Weaknesses: CWE-122
- SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial
- Assigned by: mitre

## Description

PyTorch before v2.2.0 was discovered to contain a heap buffer overflow vulnerability in the component /runtime/vararg_functions.cpp. This vulnerability allows attackers to cause a Denial of Service (DoS) via a crafted input.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pytorch pytorch: before 2.2.0
- torch (PyPI): before 2.2.0; before b5c3a17c2c207ebefcb85043f0cf94be9b2fef81
- linuxfoundation pytorch: before 2.2.0
- torch-npu (PyPI): before 2.2.0
- pytorch (Bitnami): before 2.2.1

## Every score

- CISA-ADP: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- PyPA Advisory Database: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/pytorch/pytorch/commit/b5c3a17c2c207ebefcb85043f0cf94be9b2fef81> (fix, patch, web)
- <https://gist.github.com/1047524396/038c78f2f007345e6f497698ace2aa3d> (advisory, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-31580> (advisory, web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2024-252.yaml> (web)
- <https://github.com/pytorch/pytorch> (package)
- <https://security.snyk.io/vuln/SNYK-PYTHON-TORCH-6649934> (web)
- <https://github.com/advisories/GHSA-5pcm-hx3q-hm94> (advisory)

## Sources

- CVE List: [CVE-2024-31580](https://www.cve.org/CVERecord?id=CVE-2024-31580), CVE Terms of Use, modified 2025-03-28
- GitHub Advisory Database: [GHSA-5pcm-hx3q-hm94](https://github.com/advisories/GHSA-5pcm-hx3q-hm94), CC-BY-4.0, modified 2026-07-27
- NVD: [CVE-2024-31580](https://nvd.nist.gov/vuln/detail/CVE-2024-31580), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2024-252](https://osv.dev/vulnerability/PYSEC-2024-252), CC-BY-4.0, modified 2026-07-27
- PyPA Advisory Database: [PYSEC-2024-328](https://osv.dev/vulnerability/PYSEC-2024-328), CC-BY-4.0, modified 2026-07-27
- Bitnami Vulnerability Database: [BIT-PYTORCH-2024-31580](https://osv.dev/vulnerability/BIT-PYTORCH-2024-31580), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2024-31580 · Whole record: https://cve.day/CVE-2024-31580.json · Rebuilt by cve.day 2026-11-25T22:58:39.421Z
