CVE-2025-55554: PyTorch: integer overflow in nan_to_num causes DoS
MEDIUM PoC AVAILABLECVE-2025-55554 affects PyTorch 2.8.0 with an integer overflow in torch.nan_to_num when casting to long, exploitable remotely with no authentication to crash inference services. Impact is availability-only — no data exposure or code execution. If your ML serving infrastructure runs PyTorch 2.8.0, assess exposure of inference endpoints and prioritize patching when upstream releases a fix.
What is the risk?
Medium risk with narrow exploitability window specific to PyTorch 2.8.0. CVSS 5.3 (AV:N/AC:L/PR:N/UI:N) means it can be triggered over the network without credentials, but blast radius is limited to service availability. Not in CISA KEV. No evidence of active exploitation. Risk elevates significantly for organizations exposing PyTorch inference APIs directly to untrusted networks or user-controlled inputs that flow into numerical preprocessing stages.
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-
Inventory all deployments using PyTorch 2.8.0 and identify services exposing inference to external inputs.
-
Monitor https://github.com/pytorch/pytorch/issues/151510 for official patch release.
-
Workaround: add input validation to reject or clamp extreme numerical values before calling nan_to_num; avoid .long() conversion on untrusted float tensors without bounds checking.
-
For production serving, wrap inference calls in exception handlers to prevent process termination on overflow.
-
Consider pinning to a patched version as soon as one is released.
-
Detection: monitor inference service crash logs for unexpected termination correlated with nan_to_num stack traces.
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-55554?
CVE-2025-55554 affects PyTorch 2.8.0 with an integer overflow in torch.nan_to_num when casting to long, exploitable remotely with no authentication to crash inference services. Impact is availability-only — no data exposure or code execution. If your ML serving infrastructure runs PyTorch 2.8.0, assess exposure of inference endpoints and prioritize patching when upstream releases a fix.
Is CVE-2025-55554 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-55554, increasing the risk of exploitation.
How to fix CVE-2025-55554?
1. Inventory all deployments using PyTorch 2.8.0 and identify services exposing inference to external inputs. 2. Monitor https://github.com/pytorch/pytorch/issues/151510 for official patch release. 3. Workaround: add input validation to reject or clamp extreme numerical values before calling nan_to_num; avoid .long() conversion on untrusted float tensors without bounds checking. 4. For production serving, wrap inference calls in exception handlers to prevent process termination on overflow. 5. Consider pinning to a patched version as soon as one is released. 6. Detection: monitor inference service crash logs for unexpected termination correlated with nan_to_num stack traces.
What systems are affected by CVE-2025-55554?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, inference APIs, data preprocessing pipelines.
What is the CVSS score for CVE-2025-55554?
CVE-2025-55554 has a CVSS v3.1 base score of 5.3 (MEDIUM). The EPSS exploitation probability is 0.29%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
pytorch v2.8.0 was discovered to contain an integer overflow in the component torch.nan_to_num-.long().
Exploitation Scenario
An adversary targets a publicly accessible ML inference API (e.g., a feature scoring or anomaly detection service) built on PyTorch 2.8.0. They craft a payload containing extreme floating-point values (NaN, +Inf, or values near INT64_MAX) in the input tensor. When the service preprocesses the input using torch.nan_to_num(...).long(), the integer overflow triggers, crashing the inference worker. In a Kubernetes or containerized deployment, the crashed pod restarts automatically, but repeated requests create a sustained DoS — effectively making the AI service unavailable without needing any authentication or special privileges. This is particularly damaging in real-time scoring pipelines (fraud detection, content moderation) where availability is SLA-critical.
Weaknesses (CWE)
CWE-190 — Integer Overflow or Wraparound: The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
- [Requirements] Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
- [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L 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