CVE-2025-3121: PyTorch: memory corruption in JIT flatbuffer loader

MEDIUM PoC AVAILABLE CISA: TRACK*
Published April 2, 2025
CISO Take

CVE-2025-3121 affects PyTorch 2.6.0's JIT module deserialization from FlatBuffer files, causing memory corruption that crashes the process (availability impact only). Local access and low privileges are required, limiting exposure primarily to shared ML platforms, Jupyter environments, and CI/CD pipelines where untrusted model files may be loaded. Audit who can supply model files to your PyTorch inference or training processes and restrict loading to trusted sources until an official patch is released.

Risk Assessment

Medium severity (CVSS 5.5) with constrained real-world impact. The local attack vector significantly reduces exploitability in production cloud deployments, but raises risk in multi-tenant ML platforms, shared GPU clusters, and developer workstations where PyTorch 2.6.0 is installed. The exploit is public, complexity is low, and no authentication beyond OS-level user access is required. Impact is limited to denial-of-service (crash); no confidentiality or integrity breach. Risk elevates in environments where model files originate from external or unvalidated sources.

Affected Systems

Package Ecosystem Vulnerable Range Patched
pytorch pip No patch
99.6K OpenSSF 6.4 21.7K dependents Pushed 6d ago 8% patched ~142d to patch Full package profile →

Do you use pytorch? You're affected.

Severity & Risk

CVSS 3.1
5.5 / 10
EPSS
0.1%
chance of exploitation in 30 days
Higher than 26% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

Recommended Action

6 steps
  1. Identify all systems running PyTorch 2.6.0 and inventory where JIT FlatBuffer models are loaded.

  2. Restrict model file ingestion to verified, internally-signed artifacts only — treat model files as executable code.

  3. Monitor PyTorch's GitHub issue #149800 and security advisories for an official patch; apply immediately when available.

  4. For interim mitigation, avoid using torch.jit.jit_module_from_flatbuffer with models from untrusted or external sources.

  5. In shared environments (JupyterHub, ML platforms), enforce filesystem ACLs to prevent users from supplying arbitrary model files to shared inference services.

  6. Detection: alert on unexpected PyTorch process crashes or OOM signals in inference/training logs.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6 - AI system security
NIST AI RMF
MANAGE 2.2 - Risks or incidents associated with third-party AI systems are managed
OWASP LLM Top 10
LLM05:2025 - Insecure Output Handling / Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2025-3121?

CVE-2025-3121 affects PyTorch 2.6.0's JIT module deserialization from FlatBuffer files, causing memory corruption that crashes the process (availability impact only). Local access and low privileges are required, limiting exposure primarily to shared ML platforms, Jupyter environments, and CI/CD pipelines where untrusted model files may be loaded. Audit who can supply model files to your PyTorch inference or training processes and restrict loading to trusted sources until an official patch is released.

Is CVE-2025-3121 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2025-3121, increasing the risk of exploitation.

How to fix CVE-2025-3121?

1. Identify all systems running PyTorch 2.6.0 and inventory where JIT FlatBuffer models are loaded. 2. Restrict model file ingestion to verified, internally-signed artifacts only — treat model files as executable code. 3. Monitor PyTorch's GitHub issue #149800 and security advisories for an official patch; apply immediately when available. 4. For interim mitigation, avoid using torch.jit.jit_module_from_flatbuffer with models from untrusted or external sources. 5. In shared environments (JupyterHub, ML platforms), enforce filesystem ACLs to prevent users from supplying arbitrary model files to shared inference services. 6. Detection: alert on unexpected PyTorch process crashes or OOM signals in inference/training logs.

What systems are affected by CVE-2025-3121?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference, model registries, CI/CD model validation.

What is the CVSS score for CVE-2025-3121?

CVE-2025-3121 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.09%.

Technical Details

NVD Description

A vulnerability classified as problematic has been found in PyTorch 2.6.0. Affected is the function torch.jit.jit_module_from_flatbuffer. The manipulation leads to memory corruption. Local access is required to approach this attack. The exploit has been disclosed to the public and may be used.

Exploitation Scenario

An adversary with local user access on a shared ML platform (e.g., a data scientist account on a GPU cluster) crafts a malformed FlatBuffer file and places it in a shared model repository or uploads it via an API endpoint that triggers model loading. When the inference service or validation pipeline calls torch.jit.jit_module_from_flatbuffer on the malicious file, memory corruption occurs and the process crashes. In a model-serving context, this results in a denial-of-service for downstream applications depending on that inference endpoint. In a CI/CD context, this silently kills model validation jobs, potentially allowing bad models to progress unchecked if crash handling is not properly monitored.

Weaknesses (CWE)

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Timeline

Published
April 2, 2025
Last Modified
May 27, 2025
First Seen
April 2, 2025

Related Vulnerabilities