CVE-2025-55560: PyTorch: DoS via sparse/dense tensor Inductor compile
HIGH PoC AVAILABLEPyTorch v2.7.0 models using sparse-to-dense tensor conversions will crash inference services when compiled with Inductor (torch.compile()). An attacker who can influence model architecture or submit crafted models to a compilation endpoint can take down your ML serving infrastructure with no authentication required. Disable Inductor compilation for untrusted models immediately and track the fix in PR #151897.
Risk Assessment
High risk for organizations exposing PyTorch model compilation or inference endpoints to untrusted inputs. CVSS 7.5 with network vector, low complexity, and no privileges required makes this trivially exploitable once a target is identified. Blast radius is limited to availability — no data exfiltration risk — but ML serving outages in production pipelines can cascade to business-critical systems. Risk is elevated for MLaaS platforms, model-as-a-service APIs, and CI/CD pipelines that automatically compile submitted models.
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-
IMMEDIATE
Audit deployments for PyTorch v2.7.0 with torch.compile() enabled — inventory all services.
-
WORKAROUND
Disable Inductor compilation for models containing sparse tensor operations by setting backend='eager' or backend='aot_eager' until patch is available.
-
PATCH
Monitor pytorch/pytorch PR #151897 for merge and upgrade as soon as a fixed release ships.
-
DETECTION
Add model graph inspection prior to compilation to reject models with to_sparse()/to_dense() operation chains in untrusted contexts.
-
BOUNDARY CONTROL
If accepting external models for compilation, sandbox the compilation step with resource limits (ulimit, cgroups) and process isolation to contain the DoS impact.
-
MONITOR
Alert on abnormal memory/CPU spikes in model compilation workers as an indicator of exploitation attempts.
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-55560?
PyTorch v2.7.0 models using sparse-to-dense tensor conversions will crash inference services when compiled with Inductor (torch.compile()). An attacker who can influence model architecture or submit crafted models to a compilation endpoint can take down your ML serving infrastructure with no authentication required. Disable Inductor compilation for untrusted models immediately and track the fix in PR #151897.
Is CVE-2025-55560 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-55560, increasing the risk of exploitation.
How to fix CVE-2025-55560?
1. IMMEDIATE: Audit deployments for PyTorch v2.7.0 with torch.compile() enabled — inventory all services. 2. WORKAROUND: Disable Inductor compilation for models containing sparse tensor operations by setting backend='eager' or backend='aot_eager' until patch is available. 3. PATCH: Monitor pytorch/pytorch PR #151897 for merge and upgrade as soon as a fixed release ships. 4. DETECTION: Add model graph inspection prior to compilation to reject models with to_sparse()/to_dense() operation chains in untrusted contexts. 5. BOUNDARY CONTROL: If accepting external models for compilation, sandbox the compilation step with resource limits (ulimit, cgroups) and process isolation to contain the DoS impact. 6. MONITOR: Alert on abnormal memory/CPU spikes in model compilation workers as an indicator of exploitation attempts.
What systems are affected by CVE-2025-55560?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference optimization, MLaaS platforms, automated model evaluation.
What is the CVSS score for CVE-2025-55560?
CVE-2025-55560 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.12%.
Technical Details
NVD Description
An issue in pytorch v2.7.0 can lead to a Denial of Service (DoS) when a PyTorch model consists of torch.Tensor.to_sparse() and torch.Tensor.to_dense() and is compiled by Inductor.
Exploitation Scenario
An adversary targeting a company's public-facing model evaluation API (e.g., a platform that accepts user-uploaded PyTorch models for benchmarking) crafts a minimal model that chains torch.Tensor.to_sparse() and torch.Tensor.to_dense() operations. They submit the model via the API. The backend service automatically calls torch.compile() with the default Inductor backend, triggering uncontrolled resource consumption that crashes the worker process. By submitting multiple crafted models in rapid succession, the adversary sustains a denial of service, taking down the inference cluster. No credentials or prior access required — only knowledge of the PyTorch API, which is publicly documented.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H References
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