GHSA-53q9-r3pm-6pq6

Suggest an improvement
Source
https://github.com/advisories/GHSA-53q9-r3pm-6pq6
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/04/GHSA-53q9-r3pm-6pq6/GHSA-53q9-r3pm-6pq6.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-53q9-r3pm-6pq6
Aliases
Published
2025-04-18T15:19:28Z
Modified
2025-04-22T07:58:41.347412Z
Severity
  • 9.3 (Critical) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
Details

Description

I found a Remote Command Execution (RCE) vulnerability in the PyTorch. When load model using torch.load with weights_only=True, it can still achieve RCE.

Background knowledge

https://github.com/pytorch/pytorch/security As you can see, the PyTorch official documentation considers using torch.load() with weights_only=True to be safe. image Since everyone knows that weightsonly=False is unsafe, so they will use the weightsonly=True to mitigate the security issue. But now, I just proved that even if you use weights_only=True, it still can achieve RCE. So it is time to update your PyTorch version~.

Credit

This vulnerability was found by Ji'an Zhou.

Database specific
{
    "nvd_published_at": "2025-04-18T16:15:23Z",
    "cwe_ids": [
        "CWE-502"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2025-04-18T15:19:28Z"
}
References

Affected packages

PyPI / torch

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.6.0

Affected versions

1.*

1.0.0
1.0.1
1.1.0
1.2.0
1.3.0
1.3.1
1.4.0
1.5.0
1.5.1
1.6.0
1.7.0
1.7.1
1.8.0
1.8.1
1.9.0
1.9.1
1.10.0
1.10.1
1.10.2
1.11.0
1.12.0
1.12.1
1.13.0
1.13.1

2.*

2.0.0
2.0.1
2.1.0
2.1.1
2.1.2
2.2.0
2.2.1
2.2.2
2.3.0
2.3.1
2.4.0
2.4.1
2.5.0
2.5.1

Database specific

{
    "last_known_affected_version_range": "<= 2.5.1"
}