CVE-2024-31583 Pytorch use-after-free vulnerability

High 7.8 Published Updated

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.

PackageAffectedFixed in
torch PyPIAll versions2.2.0
torch PyPIAll versions2.2.0
torch PyPIAll versions2.2.0
pytorch BitnamiAll versions2.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.

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.

Is CVE-2024-31583 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free