CVE-2025-3000: PyTorch memory corruption in torch.jit.script

CVE-2025-3000 · Severity: medium · CVSS 5.3 · Published 2025-03-31

PyTorch, a popular machine learning framework, is vulnerable to a memory corruption issue when using its TorchScript compilation feature. An attacker with local access to a system could potentially cause the application to crash or behave unpredictably by providing specific Python class definitions. This could lead to service interruptions or unauthorized access to sensitive information stored in memory.

Technologies: torch (PyPI), PyTorch. Vendors: PyPI, PyTorch.

Quick answers

Is CVE-2025-3000 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-3000 being exploited in the wild.
How severe is CVE-2025-3000?
Medium severity, with a CVSS score of 5.3, published 31 March 2025.
Which products and versions are affected?
torch (PyPI) <= 2.12.0, ECOSYSTEM:introduced=0,fixed=2.13.0, ECOSYSTEM:introduced=0,last_affected=2.6.0-NA; PyTorch <= 2.12.0.
Is there a fix for CVE-2025-3000?
Yes. torch (PyPI): upgrade to 2.13.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-3000 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2025-3000?
Check whether you run torch (PyPI) or PyTorch at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • torch (PyPI): upgrade to 2.13.0 or later
    pip install "torch>=2.13.0"

Technical details

A memory corruption vulnerability (CWE-119) exists in PyTorch's TorchScript compiler (torch.jit.script). The issue is triggered when defining a scripted class that includes dynamic Python structures, such as a list, within the __init__ method. This leads to a segmentation fault or memory corruption at runtime. An attacker with local access and low privileges can exploit this by executing a crafted script, potentially leading to a denial of service or arbitrary code execution. The vulnerability is confirmed in version 2.6.0 and reported to affect versions up to 2.12.0. No official patch is currently listed in the advisory.

Affected products

  • PyTorch PyTorch <= 2.12.0

Identifiers

  • CVE-2025-3000
  • GHSA-rrmf-rvhw-rf47
  • PYSEC-2025-194

Timeline

  • 2025-03-20: disclosed: Issue reported on GitHub repository
  • 2025-03-31: advisory: GitHub and NVD advisories published

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.