CVE-2025-3121: PyTorch: memory corruption in JIT flatbuffer loader
MEDIUM PoC AVAILABLE CISA: TRACK*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 |
Do you use pytorch? You're affected.
Severity & Risk
Attack Surface
Recommended Action
6 steps-
Identify all systems running PyTorch 2.6.0 and inventory where JIT FlatBuffer models are loaded.
-
Restrict model file ingestion to verified, internally-signed artifacts only — treat model files as executable code.
-
Monitor PyTorch's GitHub issue #149800 and security advisories for an official patch; apply immediately when available.
-
For interim mitigation, avoid using torch.jit.jit_module_from_flatbuffer with models from untrusted or external sources.
-
In shared environments (JupyterHub, ML platforms), enforce filesystem ACLs to prevent users from supplying arbitrary model files to shared inference services.
-
Detection: alert on unexpected PyTorch process crashes or OOM signals in inference/training logs.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
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 References
- github.com/pytorch/pytorch/issues/149800 Issue Vendor
- github.com/pytorch/pytorch/issues/149800 Issue Vendor
- vuldb.com Permissions Required VDB
- vuldb.com 3rd Party VDB
- vuldb.com Exploit 3rd Party VDB
- github.com/dylanleonard-1/ProcessUnity-3rd-Party-vendor-risk-lab Exploit
Timeline
Related Vulnerabilities
CVE-2024-5452 9.8 pytorch-lightning: RCE via deepdiff Delta deserialization
Same package: torch CVE-2023-43654 9.8 TorchServe: SSRF + RCE via unrestricted model URL loading
Same package: torch CVE-2022-45907 9.8 PyTorch: RCE via unsafe eval in JIT annotations
Same package: torch CVE-2022-0845 9.8 pytorch-lightning: code injection enables full RCE
Same package: torch CVE-2024-35198 9.8 TorchServe: URL bypass enables arbitrary model loading
Same package: torch
AI Threat Alert