CVE
CVE-2026-136426, CVE-2026-136427, CVE-2026-136428, CVE-2026-136429, CVE-2026-136430, CVE-2026-136431, CVE-2026-136432, CVE-2026-136433, CVE-2026-136435, CVE-2026-136436, CVE-2026-136437, CVE-2026-136438, CVE-2026-136439
CWE
CWE-502, CWE-78, CWE-94, CWE-22, CWE-749
Affected Surface
- PyPI `torch`: ZDI tested 2.12.1, 2.13.0 and 2.14.0. No fix exists, and the affected code is unchanged in 2.15.0 (28 October 2026)
- PyPI `deepspeed`: ZDI tested 0.18.5 and 0.18.9. No fix exists, and the affected code is unchanged in 0.20.1 (24 November 2026)
- Training, fine-tuning and inference pipelines that load checkpoints, `.pt2` archives, AOTInductor packages or `torch.compiler` artifacts from Hugging Face, shared storage, CI artifacts or users
TL;DR
On 24 November 2026 the Zero Day Initiative (ZDI) published 13 advisories for PyTorch and DeepSpeed as 0-days. Eight are in PyTorch and five are in DeepSpeed. Every one follows the same pattern: a file that looks like model data (a checkpoint, a .pt2 archive, an AOTInductor package, a saved torch.compiler function) runs attacker code when your process loads it. ZDI scores most of them CVSS 7.8 because a user or pipeline has to load the file, but “load a model from the internet” is the normal workflow for these libraries.
Neither project is shipping a fix. PyTorch closed each report as expected behavior and points to its security policy, which says “running untrusted models is equivalent to running untrusted code”. The DeepSpeed timelines show ZDI asking for a response for more than nine months with no reply logged. We checked the code paths ZDI names against the current releases, PyTorch 2.15.0 and DeepSpeed 0.20.1 (published a few hours after the advisories), and they are unchanged.
What to do now:
- Don’t load checkpoints,
.pt2files, AOTInductor packages or compiled-function artifacts unless your own infrastructure produced them. Prefer safetensors for weights you download. - Set
TORCH_FORCE_WEIGHTS_ONLY_LOAD=1in training and inference environments. It forcestorch.loadinto the restricted unpickler even where the code passesweights_only=False, which coverstorch.hub.load_state_dict_from_url,torch_save_to_dcpand most of the DeepSpeed paths. It does not cover the rawpickle.loadandsystem()paths listed below. - Run any job that must touch third-party model files in a sandbox (a container or VM) with no cloud credentials, tokens or SSH keys.
Affected packages and projects
| Ecosystem | Package | Advisory / CVE | Vulnerable code | Versions ZDI tested | Fixed version |
|---|---|---|---|---|---|
| PyPI | torch | ZDI-26-1052 / CVE-2026-136426 | PT2 file parsing runs a string from the file as Python | 2.13.0 | None |
| PyPI | torch | ZDI-26-1053 / CVE-2026-136427 | AOTIModelPackageLoader passes package strings to system() | 2.12.1 | None |
| PyPI | torch | ZDI-26-1054 / CVE-2026-136432 | torch.distributed.checkpoint.FileSystemReader metadata pickle.load | 2.13.0 | None |
| PyPI | torch | ZDI-26-1055 / CVE-2026-136428 | torch.compiler.load_compiled_function unpickling | 2.13.0 | None |
| PyPI | torch | ZDI-26-1056 / CVE-2026-136429 (CVSS 7.0) | PT2 archive exposes a dangerous method | 2.13.0 | None |
| PyPI | torch | ZDI-26-1057 / CVE-2026-136430 | AOTInductor package loader path traversal | 2.14.0 | None |
| PyPI | torch | ZDI-26-1058 / CVE-2026-136431 | torch.hub.load_state_dict_from_url defaults to weights_only=False | 2.13.0 | None |
| PyPI | torch | ZDI-26-1059 / CVE-2026-136433 | torch_save_to_dcp checkpoint conversion | 2.13.0 | None |
| PyPI | deepspeed | ZDI-26-1061 / CVE-2026-136435 | InferenceEngine checkpoint loading | 0.18.5 | None |
| PyPI | deepspeed | ZDI-26-1062 / CVE-2026-136436 | TorchCheckpointEngine.load | 0.18.5 | None |
| PyPI | deepspeed | ZDI-26-1063 / CVE-2026-136437 | zero_to_fp32.parse_optim_states | 0.18.9 | None |
| PyPI | deepspeed | ZDI-26-1064 / CVE-2026-136438 | build_engine_from_ds_checkpoint reads ds_model_config.pkl | 0.18.9 | None |
| PyPI | deepspeed | ZDI-26-1065 / CVE-2026-136439 | ds_to_universal._get_zero_stage | 0.18.9 | None |
The version column is what ZDI listed in each CVE record, not a lower bound. These functions have behaved this way for many releases, and the latest versions (torch 2.15.0, deepspeed 0.20.1) still contain them. On PyPI, torch had about 57.7 million downloads and deepspeed about 1.19 million in the month to 25 November.
Technical analysis
ZDI’s advisories name the function or component and the bug class but publish no proof of concept. The snippets below come from the PyTorch v2.15.0 tag and the DeepSpeed 0.20.1 sdist, so they show the code that ships today.
Why a checkpoint can run code
torch.save writes Python pickle data. Unpickling calls whatever callable the stream names, so a file can carry an object whose __reduce__ returns something like (os.system, ("id",)), and the loader calls it. PyTorch has a restricted unpickler (weights_only=True) that allows only tensors and a short list of safe types, and it became the torch.load default in 2.6. Every DeepSpeed bug and four of the PyTorch bugs come down to code that explicitly opts out of that restriction, or skips torch.load and calls pickle directly.
PyTorch: torch.hub.load_state_dict_from_url (CVE-2026-136431)
# torch/hub.py (v2.15.0)
def load_state_dict_from_url(
url: str,
model_dir: str | None = None,
map_location: MAP_LOCATION = None,
progress: bool = True,
check_hash: bool = False,
file_name: str | None = None,
weights_only: bool = False, # (1)
) -> dict[str, Any]:
...
cached_file = os.path.join(model_dir, filename)
if not os.path.exists(cached_file):
download_url_to_file(url, cached_file, hash_prefix, progress=progress) # (2)
if _is_legacy_zip_format(cached_file):
return _legacy_zip_load(cached_file, model_dir, map_location, weights_only)
return torch.load(cached_file, map_location=map_location, weights_only=weights_only) # (3)
- The hub helper keeps the pre-2.6 default of
weights_only=False, even though plaintorch.loadnow defaults toTrue. - It downloads whatever the URL serves.
check_hashis off by default, and even when it’s on it only checks a hash prefix taken from the file name. - The file then goes through the full unpickler. Any code that calls
load_state_dict_from_url(url)with a URL an attacker controls or can influence will execute the payload. That includes model zoos, config-driven loaders and notebook snippets copied from a README.
ZDI’s timeline for this one says PyTorch closed the report as a known issue.
PyTorch: distributed checkpoint readers (CVE-2026-136432, CVE-2026-136433)
# torch/distributed/checkpoint/filesystem.py (v2.15.0)
class FileSystemReader(StorageReader):
...
def read_metadata(self, *args: Any, **kwargs: Any) -> Metadata:
rank = kwargs.get("rank")
path = self._get_metadata_path(rank)
with self.fs.create_stream(path, "rb") as metadata_file:
metadata = pickle.load(metadata_file) # raw pickle, no allow-list
# torch/distributed/checkpoint/format_utils.py (v2.15.0)
def torch_save_to_dcp(torch_save_path, dcp_checkpoint_dir):
state_dict = torch.load(torch_save_path, weights_only=False)
dcp.load() reads the .metadata file of a checkpoint directory with plain pickle.load, so a downloaded sharded checkpoint runs code before any tensor is touched. torch_save_to_dcp, the helper that converts a regular torch.save file into the distributed format, opts out of weights_only on its input. PyTorch’s SECURITY.md names this exact helper and says distributed checkpoints “are not artifacts you download from the internet or accept from untrusted third parties”, and that “the weights_only protections of torch.load do not apply here”.
PyTorch: torch.compiler.load_compiled_function (CVE-2026-136428)
# torch/compiler/__init__.py (v2.15.0)
def load_compiled_function(file, *, f_globals=None, external_data=None):
from torch._dynamo.aot_compile import AOTCompiledFunction
data = file.read()
return AOTCompiledFunction.deserialize(data, f_globals, external_data, guard_globals=f_globals)
# torch/_dynamo/aot_compile.py (v2.15.0)
class AOTCompileUnpickler(pickle.Unpickler): # no find_class override
...
results: list[bytes] = pickle.loads(data)
...
unpickler = AOTCompileUnpickler(external_closure_data or {}, f)
state = unpickler.load()
The experimental AOT-compile API serializes Dynamo output, including bytecode, with pickle. AOTCompileUnpickler overrides only persistent_load and leaves find_class alone, so any global is allowed. A shared “precompiled” artifact is therefore a code-execution primitive.
PyTorch: AOTInductor package loader (CVE-2026-136427, CVE-2026-136430)
AOTInductor packages (.pt2 files produced by torch._inductor.aoti_compile_and_package) can ship C++ source that the loader compiles on the target machine. The compiler command comes from JSON inside the package:
// torch/csrc/inductor/aoti_package/model_package_loader.cpp (v2.15.0, abridged, non-Windows branch)
std::string compiler = compile_options["compiler"].get<std::string>(); // (1)
...
for (auto& arg : compile_options["cflags"]) {
cflags_args += std::string(_is_windows_os() ? "/" : "-") + arg.get<std::string>() + " "; // (2)
}
...
cmd = fmt::format("{} {} {} {} {} {} {} {}", compiler, source_args, definitions_args,
cflags_args, include_dirs_args, passthrough_parameters_args,
output_flags, target_file); // (3)
...
const nlohmann::json compile_flags = load_json_file(compile_flags_path); // *_compile_flags.json
...
TORCH_CHECK(system(compile_cmd.c_str()) == 0, "Failed to compile cpp file."); // (4)
TORCH_CHECK(system(link_cmd.c_str()) == 0, "Failed to link files.");
compileris a string from the package’s*_compile_flags.json.- Flags, defines, include directories and passthrough arguments from the same JSON are appended with no quoting.
- The parts are joined into one shell command line.
system()hands that line to/bin/sh. A package whosecompilerissh -c '<payload>' #runs the payload when it is loaded.
The second AOTInductor bug (CVE-2026-136430, reported by Alex Williams) is a directory traversal. ZDI says the loader uses a path from the package in file operations without validating it, which leads to code execution as the current user. ZDI did not publish which path or file operation is involved.
PyTorch: PT2 archives (CVE-2026-136426, CVE-2026-136429)
The two remaining PyTorch advisories cover .pt2 archive parsing. In ZDI-26-1052, a string from the file reaches code that executes Python without validation. ZDI-26-1056 describes “an exposed dangerous function” and is rated a little lower (CVSS 7.0, high attack complexity). ZDI did not name the functions, so we won’t guess. For defenders the point is the same: torch.export.load and the PT2 archive readers belong on the list of loaders that must only see trusted files.
DeepSpeed: five weights_only=False and pickle.load sites
DeepSpeed calls torch.load(..., weights_only=False) in more than 40 places in 0.20.1. The five ZDI cases:
# deepspeed/inference/engine.py (CVE-2026-136435, InferenceEngine)
self.sd = torch.load(checkpoint[0], map_location='cpu', weights_only=False)
# deepspeed/runtime/checkpoint_engine/torch_checkpoint_engine.py (CVE-2026-136436)
def load(self, path: str, map_location=None):
partition = torch.load(path, map_location=map_location, weights_only=False)
# deepspeed/utils/zero_to_fp32.py (CVE-2026-136437, parse_optim_states)
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
# deepspeed/inference/v2/engine_factory.py (CVE-2026-136438, build_engine_from_ds_checkpoint)
model_config = pickle.load(open(os.path.join(path, "ds_model_config.pkl"), "rb"))
# deepspeed/checkpoint/ds_to_universal.py (CVE-2026-136439, _get_zero_stage)
state_dict = torch.load(optim_files[0], map_location=torch.device('cpu'), weights_only=False)
zero_to_fp32.py deserves a mention. DeepSpeed copies it into every checkpoint directory it saves, and people run it on checkpoints they download to turn ZeRO shards into a single fp32 state dict. A poisoned optimizer shard runs code during that conversion. build_engine_from_ds_checkpoint skips torch.load entirely and unpickles ds_model_config.pkl, so TORCH_FORCE_WEIGHTS_ONLY_LOAD doesn’t help there.
Disclosure history
| Advisory | Submitted | Vendor response logged by ZDI | Credit |
|---|---|---|---|
| ZDI-26-1052, 1053, 1054 | 17 Jul 2026 | Rejected as expected behavior on 23 Jul | YJK (@YJK0805) of ZUSO ART |
| ZDI-26-1056 | 1 Aug 2026 | Rejected as expected behavior on 4 Aug | YJK (@YJK0805) of ZUSO ART |
| ZDI-26-1055 | 6 Aug 2026 | Rejected as expected behavior on 7 Aug | YJK (@YJK0805) of ZUSO ART |
| ZDI-26-1059 | 26 Aug 2026 | Rejected as expected behavior on 1 Sep | YJK (@YJK0805) of ZUSO ART |
| ZDI-26-1058 | 27 Aug 2026 | Rejected as known on 1 Sep | YJK (@YJK0805) of ZUSO ART |
| ZDI-26-1057 | 2 Sep 2026 | Rejected as expected behavior on 15 Sep | Alex Williams |
| ZDI-26-1061, 1062 | 5 and 12 Feb 2026 | None logged; ZDI followed up in April, June, August and September | Michael DePlante (@izobashi), TrendAI ZDI |
| ZDI-26-1063, 1064, 1065 | 7 May 2026 | None logged; ZDI followed up in June, August and September | Bongeun Koo (@kiddo_pwn) |
ZDI’s mitigation line for all 13 is the same: “restrict interaction with the product”.
Is this a vulnerability or documented behavior?
Both, depending on who you ask. PyTorch’s position is consistent and written down: models are programs, and SECURITY.md says issues under “Using PyTorch Securely” are not vulnerabilities. ZDI’s position is that APIs which fetch files from URLs or convert third-party checkpoints, and which pass weights_only=False by default, invite exactly the misuse the policy warns about. For a team running these libraries, the disagreement doesn’t change much. No patch is coming, CVE scanners will start flagging every torch and deepspeed install, and the loaders listed here have to be treated like eval.
On the same day ZDI also published a pip 0-day (ZDI-26-1066, CVE-2026-136440), a local privilege escalation through configuration file permissions that the pip maintainers declined in May 2025.
IOCs
These are library design flaws, not a malware campaign, so there are no network indicators. As of 25 November 2026 there is no public proof of concept, no report of exploitation, no EPSS score and no CISA KEV listing for any of the 13 CVEs. The useful artifacts to hunt for are inputs:
.pt,.pth,.binand.ckptfiles loaded withweights_only=Falsefrom outside your own storage- distributed checkpoint directories whose
.metadatafile contains pickle opcodes that importos,subprocess,builtinsorposix - AOTInductor
.pt2packages whose*_compile_flags.jsoncompilerfield is anything other than a plain compiler path such asg++orclang++ - DeepSpeed checkpoint directories with a
ds_model_config.pklfrom a third party
Detection and remediation
Find which versions you run:
pip show torch deepspeed 2>/dev/null | grep -E '^(Name|Version)'
python -c "import torch; print(torch.__version__)"
grep -inE '^(torch|deepspeed)[=<>~ ]' requirements*.txt pyproject.toml poetry.lock uv.lock 2>/dev/null
Find the risky call sites in your own code:
grep -rnE 'load_state_dict_from_url|torch_save_to_dcp|FileSystemReader|dcp\.load|load_compiled_function|aoti_load_package|AOTIModelPackageLoader|torch\.export\.load|build_engine_from_ds_checkpoint|zero_to_fp32|ds_to_universal' --include='*.py' .
grep -rn 'weights_only=False' --include='*.py' .
Inspect a pickle without running it. pickletools disassembles the opcodes and never executes them:
python -m pickletools path/to/checkpoint/.metadata | grep -nE "GLOBAL|STACK_GLOBAL|INST" | head
unzip -p model.pt data.pkl | python -m pickletools - | grep -nE "GLOBAL|STACK_GLOBAL" | head
Check AOTInductor packages before loading them:
unzip -l model.pt2 | grep -E '_compile_flags\.json|_linker_flags\.json'
unzip -p model.pt2 '*_compile_flags.json' | python -m json.tool | grep -E '"compiler"|passthrough'
Remediation:
- Export
TORCH_FORCE_WEIGHTS_ONLY_LOAD=1in training, fine-tuning and serving images. This closes thetorch.loadpaths (CVE-2026-136431, CVE-2026-136433 and the DeepSpeedtorch.loadcases). Loads that genuinely need full pickle will fail and will need an explicit allow-list throughtorch.serialization.add_safe_globals. - Replace
torch.hub.load_state_dict_from_url(url)with a download you verify against a pinned full SHA-256, thentorch.load(path, weights_only=True), or switch to safetensors. - Don’t call
dcp.load,torch.compiler.load_compiled_function,aoti_load_packageor DeepSpeed’s checkpoint and conversion helpers on files from Hugging Face, issue attachments or other teams’ buckets. If you have to, do it in a throwaway container without credentials. - Gate model ingestion in CI. Scan third-party model files with a pickle scanner before they reach a GPU node, and make writes to your checkpoint buckets as restricted as writes to your container registry.
- If a pipeline already loaded an untrusted file through one of these paths, treat that host as compromised. Rotate the cloud credentials, Hugging Face tokens, Weights & Biases keys and SSH keys it had access to.
Timeline
- 5 February 2026: ZDI reports the first DeepSpeed issue (ZDI-26-1061).
- 12 February 2026: ZDI reports a second DeepSpeed issue (ZDI-26-1062).
- 7 May 2026: Bongeun Koo’s three DeepSpeed reports go to the maintainers (ZDI-26-1063 to 1065).
- 17 July to 2 September 2026: ZDI submits eight PyTorch reports through GitHub. PyTorch closes each within one to 13 days as expected behavior or known.
- 3 November 2026: ZDI tells PyTorch it will publish the cases as 0-days.
- 19 November 2026: ZDI tells DeepSpeed it will publish as 0-days.
- 24 November 2026, 18:40 to 18:41 UTC: The 13 CVE records are published; ZDI posts the advisories the same day.
- 24 November 2026, 21:40 UTC: DeepSpeed 0.20.1 is uploaded to PyPI with no security changes; the affected code is unchanged.
References
- ZDI-26-1058: PyTorch load_state_dict_from_url (CVE-2026-136431)
- ZDI-26-1053: PyTorch AOTIModelPackageLoader command injection (CVE-2026-136427)
- ZDI-26-1054: PyTorch FileSystemReader (CVE-2026-136432)
- ZDI-26-1061: DeepSpeed InferenceEngine (CVE-2026-136435)
- ZDI-26-1065: DeepSpeed _get_zero_stage (CVE-2026-136439)
- ZDI published advisories
- PyTorch SECURITY.md (v2.15.0)
- PyTorch v2.15.0
torch/hub.py - PyTorch v2.15.0 AOTInductor
model_package_loader.cpp - DeepSpeed v0.20.1 release notes
- CVE.org: CVE-2026-136431
From research to remediation
Check whether this pattern exists in your codebase
Turn this research into a remediation workflow. Scan dependencies and package manifests for similar supply-chain risk, then prioritize fixes with reachability context.
References
- ZDI-26-1058 (CVE-2026-136431): PyTorch load_state_dict_from_url deserialization 0-day
- ZDI-26-1053 (CVE-2026-136427): PyTorch AOTIModelPackageLoader command injection 0-day
- ZDI-26-1054 (CVE-2026-136432): PyTorch FileSystemReader deserialization 0-day
- ZDI-26-1061 (CVE-2026-136435): DeepSpeed InferenceEngine deserialization 0-day
- ZDI-26-1065 (CVE-2026-136439): DeepSpeed _get_zero_stage deserialization 0-day
- ZDI published advisories list (ZDI-26-1052 to ZDI-26-1065)
- PyTorch SECURITY.md: Using PyTorch Securely (untrusted models, distributed checkpoints)
- PyTorch v2.15.0 source: torch/hub.py load_state_dict_from_url
- PyTorch v2.15.0 source: AOTInductor model_package_loader.cpp
- DeepSpeed v0.20.1 release (24 November 2026)
- CVE.org: CVE-2026-136431