CVE-2024-31583 Pytorch use-after-free vulnerability
A use-after-free flaw in PyTorch's mobile interpreter allows attackers to potentially execute arbitrary code or cause a denial of service.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-31583?
CVE-2024-31583 is a high-severity use after free vulnerability in n/a, published on 17 Apr 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Pytorch before version v2.2.0 was discovered to contain a use-after-free vulnerability in torch/csrc/jit/mobile/interpreter.cpp.
Weakness: CWE-416
Which versions are affected by CVE-2024-31583?
4 open source packages ship an affected version, including torch and pytorch. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
torch PyPI | All versions | 2.2.0 |
torch PyPI | All versions | 2.2.0 |
torch PyPI | All versions | 2.2.0 |
pytorch Bitnami | All versions | 2.2.1 |
Products include Linuxfoundation Pytorch.
How do I fix CVE-2024-31583?
Upgrade torch to 2.2.0 or later.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2024-31583 being exploited?
There is no known exploitation of CVE-2024-31583 in the wild and no public exploit code.
Other vulnerabilities in n/a
- CVE-2024-48063 Deserialization in n/a
- CVE-2022-45907 PyTorch vulnerable to arbitrary code execution
- CVE-2025-32434 PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
- CVE-2026-24747 PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files
- CVE-2025-55551 Denial of service in n/a
Sources
Also known as AZL-39942, BIT-pytorch-2024-31583, DEBIAN-CVE-2024-31583, GHSA-pg7h-5qx3-wjr3, PYSEC-2024-251, UBUNTU-CVE-2024-31583.