PyTorchGHSA-pg7h-5qx3-wjr3
Pytorch use-after-free vulnerability
High7.8CVE-2024-31583 · Published Apr 17, 2024 · updated Jun 11, 2025
Pytorch before version v2.2.0 was discovered to contain a use-after-free vulnerability in torch/csrc/jit/mobile/interpreter.cpp.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| torch PyPI | < 2.2.0 | 2.2.0 |
Details and references
- CVSS 3.1
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-416
- Also known as
- BIT-pytorch-2024-31583, CVE-2024-31583, PYSEC-2024-251
- nvd.nist.gov/vuln/detail/CVE-2024-31583
- github.com/pytorch/pytorch/commit/9c7071b0e324f9fb68ab881283d6b8d388a4bcd2
- gist.github.com/1047524396/43e19a41f2b36503a4a228c32cdbc176
- github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2024-251.yaml
- github.com/pytorch/pytorch
- github.com/pytorch/pytorch/blob/v2.1.2/torch/csrc/jit/mobile/interpreter.cpp#L132
- security.snyk.io/vuln/SNYK-PYTHON-TORCH-6619806
More PyTorch advisories
All PyTorch| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Mar 302025 | PyTorch susceptible to local Denial of Service | Low3.3 | 2.7.1-rc1 |
| Mar 102025 | A vulnerability was found in PyTorch 2.6.0+cu124 | Low2.5 | No fix yet |
| Mar 102025 | PyTorch Tuple Handler is Vulnerable to Memory Corruption through Manipulation of None Argument | Low5.0 | No fix yet |
| Oct 292024 | PyTorch: unsafe deserialization | Critical9.8 | 2.5.0 |
| Apr 192024 | PyTorch: out-of-bounds read | Medium5.5 | 2.2.0 |
| Apr 172024 | PyTorch heap buffer overflow vulnerability | High7.5 | 2.2.0 |