﻿# PyTorch CVE-2026-24747: weights_only restricted loading still needs a patched runtime

Read the original PyTorch restricted-unpickler advisory, its affected versions and trust boundary without treating CPU placement or a loader flag as a complete security guarantee.

Author: Retrivium editorial team
Updated: 2026-11-05
Canonical URL: https://retrivium.ai/journal/pytorch-cve-2026-24747-weights-only-runtime-trust-boundary/
Language: en

PyTorch's January 26, 2026 advisory describes a vulnerability in its restricted checkpoint loader. The relevant trigger is loading an attacker-supplied checkpoint through the affected runtime, even when weights_only is enabled. This is a defensive example of why a narrower deserialization policy and a correctly patched implementation are separate requirements.

## Preserve the affected path and version scope

The [original project advisory](https://github.com/pytorch/pytorch/security/advisories/GHSA-63cw-57p8-fm3p), identified as CVE-2026-24747, lists versions through 2.9.1 as affected and 2.10.0 as the patched release boundary. That is the historical advisory scope, not a claim that every future release or every downstream package has been independently tested here.

The described defects concern validation of container operations and storage metadata while loading a malformed checkpoint. The advisory reports memory corruption with potential arbitrary code execution in the victim process. It does not provide a count of compromised machines or evidence that every malformed file achieves code execution.

## Restricted loading is an object policy

The [versioned loader reference](https://docs.pytorch.org/docs/2.10/generated/torch.load.html) describes weights_only as restricting the unpickler to tensors, primitive values, dictionaries and explicitly permitted types. That reduces the object-loading surface. It does not mean the remaining parser and storage implementation require no validation or cannot contain defects.

Adding allowed globals changes the accepted object set; it is not a general remedy for an untrusted artifact that failed restricted loading. Likewise, changing to unrestricted loading to make an unfamiliar checkpoint open removes a boundary rather than proving the file safe. Keep the exact loader arguments and the artifact source with the runtime version.

## CPU placement addresses a different problem

The loader reference separately documents map_location and initial CPU deserialization of tensor storage. Remapping storage can control where tensors are placed and avoid a GPU-memory surge. It does not convert an affected unpickler into a patched one or authenticate the checkpoint producer.

A loading failure, an allocation limit and an unsafe deserialization path therefore need separate diagnoses. The [artifact-validation guide](/journal/safetensors-artifact-validation/) explains why format, expected tensor structure and provenance should remain independent acceptance records. A matching filename or a plausible model response cannot replace them.

## A fixed version does not authenticate the model

The [project security policy](https://github.com/pytorch/pytorch/blob/v2.10.0/SECURITY.md) treats untrusted models and associated code as execution risks and recommends separating weight distribution from model code. It also notes that even more restricted formats do not eliminate downstream problems from unexpected inputs.

For an existing workflow, identify the actual runtime used by every loading process, including conversion jobs and background workers. Retain a supported patched build and verify that the intended loader path is the one exercised. A version recorded in a notebook is insufficient if an export worker runs another environment. This is an environment-inventory task, not a reason to execute an unknown checkpoint as a test.

## Verify recovery with trusted artifacts

Functional checks after updating should use accepted reference weights and representative inputs. Preserve source revision, manifest and expected outputs while checking loading, tensor structure and application behavior. A successful smoke test establishes a narrow functional result; it does not demonstrate that all hostile files are harmless.

The [reproducible-stack guide](/journal/software-stack-reproducibility/) provides the operational record needed to connect runtime changes with those results. The advisory supports a specific historical remediation boundary while the broader acceptance decision continues to require trustworthy artifacts, explicit loading policy and the actual software environment.
