CVE-2025-3730: Torch Remote Code Execution Vulnerability
MODERATECVE-2025-3730 is a MODERATE (CVSS 3.3) remote code execution vulnerability (CWE-404: Improper Resource Shutdown or Release) affecting Torch libraries in the PyPI ecosystem. The issue involves pytorch improper resource shutdown or release vulnerability. Remediation is available by upgrading affected packages to version 2.8.0.
CVE-2025-3730 at a Glance
Security Impact
CVSS: 3.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2025-3730
To remediate this vulnerability, upgrade all affected Torch dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install torch>=2.8.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show torch
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-3730, inspect your installed packages using pip:
pip show torch
Analyze the terminal output to locate any version of Torch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.8.0), your application is affected.
Note: The pip show torch command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-404: Improper Resource Shutdown or Release, where the product does not release or incorrectly releases a resource before it is made available for re-use. In Torch, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-3730 Affected Torch Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
torch
|
PyPI |
< 2.8.0
|
2.8.0
|
References
Frequently Asked Questions
What is CVE-2025-3730?
Which Torch versions are affected?
What version fixes CVE-2025-3730?
Is torch affected?
What is the CVSS score of CVE-2025-3730?
What CWE is associated with CVE-2025-3730?
How can I check PyPI dependencies for CVE-2025-3730?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-887c-mr87-cxwp",
"modified" : "2025-09-02T15:21:56Z",
"published" : "2025-04-16T21:30:59Z",
"aliases" : [ "CVE-2025-3730" ],
"summary" : "PyTorch Improper Resource Shutdown or Release vulnerability",
"details" : "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 name of the patch is 46fc5d8e360127361211cb237d5f9eef0223e567. It is recommended to apply a patch to fix this issue.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "torch"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.8.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.7.1"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-3730"
}, {
"type" : "WEB",
"url" : "https://github.com/pytorch/pytorch/issues/150835"
}, {
"type" : "WEB",
"url" : "https://github.com/pytorch/pytorch/pull/150981"
}, {
"type" : "WEB",
"url" : "https://github.com/pytorch/pytorch/commit/01f226bfb8f2c343f5c614a6bbf685d91160f3af"
}, {
"type" : "WEB",
"url" : "https://github.com/timocafe/tewart-pytorch/commit/46fc5d8e360127361211cb237d5f9eef0223e567"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pytorch/pytorch"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.305076"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.305076"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?submit.553645"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-404" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-04-16T21:55:36Z",
"nvd_published_at" : "2025-04-16T21:15:48Z"
}
}