CVE-2025-3730: PyTorch: DoS via ctc_loss resource mishandling
GHSA-887c-mr87-cxwp MEDIUM PoC AVAILABLE CISA: TRACK*A local denial-of-service vulnerability in PyTorch's CTC loss function allows low-privileged users to crash training processes — relevant primarily for shared ML compute environments like JupyterHub clusters or multi-user GPU servers. Production inference deployments are unaffected. Patch to torch 2.8.0+ during your next dependency cycle; no emergency response required.
What is the risk?
Low operational risk despite the medium CVSS score. The local attack vector (AV:L) eliminates remote exploitation, requiring existing system access. EPSS of 0.0005 confirms near-zero in-the-wild exploit activity, and PyTorch's own security team has questioned the CVE's existence. Highest exposure is in multi-tenant ML training infrastructure where untrusted users share a compute node. Containerized or single-tenant training environments face negligible risk.
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch: Upgrade torch to 2.8.0+ (patch commit 46fc5d8e).
-
Workaround if patching is deferred: enforce per-user process isolation in shared training environments via containers or VMs.
-
Apply cgroup/ulimit resource boundaries to training processes to limit crash blast radius.
-
In multi-tenant clusters, prohibit direct user access to shared PyTorch processes.
-
Detection: Alert on unexpected termination of training processes outside scheduled completion windows; monitor for torch process crashes correlated with ctc_loss workloads.
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-3730?
A local denial-of-service vulnerability in PyTorch's CTC loss function allows low-privileged users to crash training processes — relevant primarily for shared ML compute environments like JupyterHub clusters or multi-user GPU servers. Production inference deployments are unaffected. Patch to torch 2.8.0+ during your next dependency cycle; no emergency response required.
Is CVE-2025-3730 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-3730, increasing the risk of exploitation.
How to fix CVE-2025-3730?
1. Patch: Upgrade torch to 2.8.0+ (patch commit 46fc5d8e). 2. Workaround if patching is deferred: enforce per-user process isolation in shared training environments via containers or VMs. 3. Apply cgroup/ulimit resource boundaries to training processes to limit crash blast radius. 4. In multi-tenant clusters, prohibit direct user access to shared PyTorch processes. 5. Detection: Alert on unexpected termination of training processes outside scheduled completion windows; monitor for torch process crashes correlated with ctc_loss workloads.
What systems are affected by CVE-2025-3730?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, shared ML compute environments, notebook environments, CI/CD model training.
What is the CVSS score for CVE-2025-3730?
CVE-2025-3730 has a CVSS v3.1 base score of 5.5 (MEDIUM). The EPSS exploitation probability is 0.27%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service AML.T0034 Cost Harvesting Compliance Controls Affected
What are the technical details?
Original Advisory
A vulnerability, which was classified as problematic, was found in PyTorch 2.6.0. Affected is the function torch.nn.functional.ctc_loss of the file aten/src/ATen/native/LossCTC.cpp. The manipulation leads to denial of service. An attack has to be approached locally. The exploit has been disclosed to the public and may be used. The real existence of this vulnerability is still doubted at the moment. The name of the patch is 46fc5d8e360127361211cb237d5f9eef0223e567. It is recommended to apply a patch to fix this issue. The security policy of the project warns to use unknown models which might establish malicious effects.
Exploitation Scenario
A malicious data scientist on a shared GPU training server (e.g., a JupyterHub node) with a low-privileged account calls `torch.nn.functional.ctc_loss` with a crafted input that triggers the improper resource release bug. The PyTorch process crashes, immediately terminating any co-located training jobs sharing that process — including a colleague's 72-hour fine-tuning run. No external network access or elevated privileges required; attack is trivially repeatable to sustain disruption.
Weaknesses (CWE)
CWE-404 — Improper Resource Shutdown or Release: The product does not release or incorrectly releases a resource before it is made available for re-use.
- [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, languages such as Java, Ruby, and Lisp perform automatic garbage collection that releases memory for objects that have been deallocated.
- [Implementation] It is good practice to be responsible for freeing all resources you allocate and to be consistent with how and where you free memory in a function. If you allocate memory that you intend to free upon completion of the function, you must be sure to free the memory at all exit points for that function including error conditions.
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 References
- github.com/pytorch/pytorch/issues/150835 Exploit Issue Vendor
- github.com/pytorch/pytorch/issues/150835 Exploit Issue Vendor
- github.com/pytorch/pytorch/pull/150981 Issue Patch
- github.com/timocafe/tewart-pytorch/commit/46fc5d8e360127361211cb237d5f9eef0223e567 Patch
- vuldb.com Permissions Required VDB
- vuldb.com 3rd Party VDB
- vuldb.com Exploit 3rd Party VDB
- github.com/advisories/GHSA-887c-mr87-cxwp
- github.com/pytorch/pytorch/commit/01f226bfb8f2c343f5c614a6bbf685d91160f3af
- nvd.nist.gov/vuln/detail/CVE-2025-3730
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