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.

What is the risk?

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.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
PyTorch pip No patch
100.9K OpenSSF 6.4 22.7K dependents Pushed 2d ago 11% patched ~216d to patch Full package profile →

Do you use PyTorch? You're affected.

How severe is it?

CVSS 3.1
5.5 / 10
EPSS
0.2%
chance of exploitation in 30 days
Higher than 13% 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, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the 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

What should I do?

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.

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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

How is it classified?

Which compliance frameworks are affected?

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.22%.

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesinferencemodel registriesCI/CD model validation

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0011.000 Unsafe AI Artifacts
AML.T0029 Denial of AI Service

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

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)

CWE-119 — Improper Restriction of Operations within the Bounds of a Memory Buffer: The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

  • [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.

Source: MITRE CWE corpus.

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