CVE-2025-3001: PyTorch memory corruption in torch.lstm_cell

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

PyTorch, a popular machine learning library, contains a vulnerability in its LSTM (Long Short-Term Memory) cell processing function. An attacker with local access to a system could provide specially crafted inputs to this function to cause the application to crash or corrupt its memory. This could lead to service disruptions or potentially allow for unauthorized access to sensitive information handled by the machine learning model.

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

Quick answers

Is CVE-2025-3001 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-3001 being exploited in the wild.
How severe is CVE-2025-3001?
Medium severity, with a CVSS score of 5.3, published 31 March 2025.
Which products and versions are affected?
torch (PyPI) < 2.10.0, ECOSYSTEM:introduced=0,fixed=2.10.0, ECOSYSTEM:introduced=0,last_affected=2.6.0-NA; PyTorch < 2.10.0.
Is there a fix for CVE-2025-3001?
Yes. torch (PyPI): upgrade to 2.10.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-3001 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2025-3001?
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.10.0 or later
    pip install "torch>=2.10.0"

Technical details

A memory corruption vulnerability (CWE-119) exists in PyTorch's 'torch.lstm_cell' function. The issue is triggered when the function processes specific tensor configurations, such as empty tensors or specific weight values, leading to a segmentation fault or improper restriction of operations within the bounds of a memory buffer. An attacker with local execution privileges can exploit this by passing malicious inputs to the affected function. This can result in a denial-of-service (crash) or potentially arbitrary code execution depending on the memory environment. The vulnerability was identified in version 2.6.0 and is addressed in version 2.10.0 via commit 999d94b.

Affected products

  • PyTorch PyTorch < 2.10.0

Identifiers

  • CVE-2025-3001
  • GHSA-qfhq-4f3w-5fph
  • PYSEC-2025-195

Timeline

  • 2025-03-20: disclosed: Issue reported on GitHub repository
  • 2025-03-31: advisory: GitHub and NVD advisories published
  • 2026-06-10: other: Advisory reviewed and updated

References

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