CVE-2026-24747: Pytorch Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-63cw-57p8-fm3p
CVSS 8.8
CWE-502 CWE-94
Published
Advisory Summary

CVE-2026-24747 is a HIGH (CVSS 8.8) remote code execution vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Pytorch libraries in the PyPI ecosystem. The issue involves pytorch vulnerable to remote code execution via untrusted checkpoint files. Remediation is available by upgrading affected packages to version 2.10.0.

CVE-2026-24747 at a Glance

CVE Identifier CVE-2026-24747
GHSA Identifier GHSA-63cw-57p8-fm3p
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Pytorch
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-24747

To remediate this vulnerability, upgrade all affected Pytorch dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pytorch fixed: 2.10.0
pip install pytorch>=2.10.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show pytorch

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-24747, inspect your installed packages using pip:

pip show pytorch

Analyze the terminal output to locate any version of Pytorch in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.10.0), your application is affected.

Note: The pip show pytorch command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Pytorch, 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

### Summary A vulnerability in PyTorch's `weights_only` unpickler allows an attacker to craft a malicious checkpoint file (`.pth`) that, when loaded with `torch.load(..., weights_only=True)`, can corrupt memory and potentially lead to arbitrary code execution. ### Vulnerability Details The `weights_only=True` unpickler failed to properly validate pickle opcodes and storage metadata, allowing: 1. **Heap memory corruption** via `SETITEM`/`SETITEMS` opcodes applied to non-dictionary types 2. **Storage size mismatch** between declared element count and actual data in the archive ### Impact An attacker who can convince a user to load a malicious checkpoint file may achieve arbitrary code execution in the context of the victim's process. # Credit Ji'an Zhou

CVE-2026-24747 Affected Pytorch Versions

1 component(s)
Fixed Versions:
2.10.0
Product / Package Ecosystem Affected Versions Fixed Version
pytorch
PyPI
< 2.10.0
2.10.0

References

Frequently Asked Questions

What is CVE-2026-24747?
CVE-2026-24747 is a security vulnerability in Pytorch involving PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files under CWE-502: Deserialization of Untrusted Data.
Which Pytorch versions are affected?
Affected versions include releases prior to 2.10.0 across affected packages: pytorch.
What version fixes CVE-2026-24747?
Upgrading to 2.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pytorch affected?
Yes, pytorch is affected in releases prior to 2.10.0. Upgrade your dependency to 2.10.0 or later.
What is the CVSS score of CVE-2026-24747?
CVE-2026-24747 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-24747?
CVE-2026-24747 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check PyPI dependencies for CVE-2026-24747?
Run the dependency tree command: 'pip show pytorch'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-63cw-57p8-fm3p",
  "modified" : "2026-01-29T03:42:52Z",
  "published" : "2026-01-27T20:10:54Z",
  "aliases" : [ "CVE-2026-24747" ],
  "summary" : "PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files",
  "details" : "### Summary\n\nA vulnerability in PyTorch's `weights_only` unpickler allows an attacker to craft a malicious checkpoint file (`.pth`) that, when loaded with `torch.load(..., weights_only=True)`, can corrupt memory and potentially lead to arbitrary code execution.\n\n### Vulnerability Details\n\nThe `weights_only=True` unpickler failed to properly validate pickle opcodes and storage metadata, allowing:\n\n1. **Heap memory corruption** via `SETITEM`/`SETITEMS` opcodes applied to non-dictionary types\n2. **Storage size mismatch** between declared element count and actual data in the archive\n\n### Impact\n\nAn attacker who can convince a user to load a malicious checkpoint file may achieve arbitrary code execution in the context of the victim's process.\n\n\n# Credit\nJi'an Zhou",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pytorch"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.10.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pytorch/pytorch/security/advisories/GHSA-63cw-57p8-fm3p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-24747"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytorch/pytorch/issues/163105"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pytorch/pytorch"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytorch/pytorch/163122/commit/954dc5183ee9205cbe79876ad05dd2d9ae752139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pytorch/pytorch/releases/tag/v2.10.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-27T20:10:54Z",
    "nvd_published_at" : "2026-01-27T22:15:56Z"
  }
}