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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| PyTorch | pip | — | No patch |
Do you use PyTorch? You're affected.
How severe is it?
What is the attack surface?
What should I do?
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.
What does CISA's SSVC say?
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:
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.38%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.000 Unsafe AI Artifacts AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-400 — Uncontrolled Resource Consumption: The product does not properly control the allocation and maintenance of a limited resource.
- [Architecture and Design] Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
- [Architecture and Design] Mitigation of resource exhaustion attacks requires that the target system either: The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker. recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed.
Source: MITRE CWE corpus.
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