Back to Intelligence

CVE-2026-136430: Unpatched PyTorch AOTIModelPackageLoader Directory Traversal — Detection and Mitigation Guide

SA
Security Arsenal Team
November 27, 2026
10 min read

The Zero Day Initiative has published ZDI-26-1057, disclosing an unpatched directory traversal vulnerability in the PyTorch Foundation's AOTIModelPackageLoader component, tracked as CVE-2026-136430 with a CVSS v3.1 score of 7.8 (High). Successful exploitation allows a remote attacker to execute arbitrary code in the context of the target process — and because this is a zero-day with no vendor fix available at publication time, your detection and compensating controls are the only thing standing between a malicious model package and code execution on your ML infrastructure.

User interaction is required: the victim must open a malicious file or visit a malicious page that triggers loading of a crafted model package. That is a low bar. Machine learning pipelines routinely ingest model artifacts from external sources — Hugging Face hubs, vendor-supplied checkpoints, CI/CD artifact stores, and inter-team shares. Every one of those ingestion points is now a potential delivery vector.

If your organization runs PyTorch-based inference workloads — particularly anything consuming AOTI-compiled (.pt2) model packages — treat this as an active exposure requiring immediate compensating controls.

Technical Analysis

What is affected

  • Product: PyTorch Foundation PyTorch
  • Component: AOTIModelPackageLoader — the runtime loader responsible for consuming AOT Inductor (AOTI) model packages, typically distributed as .pt2 archive files
  • Platforms: Cross-platform — any OS running an affected PyTorch build that loads AOTI packages (Linux, Windows, macOS)
  • CVE: CVE-2026-136430
  • CVSS: 7.8 (High) — vector characteristics consistent with local file interaction leading to code execution (AV:L/AC:L/PR:N/UI:R)
  • Advisory: ZDI-26-1057
  • Patch status: None. Zero-day. ZDI's standard disclosure timeline (120 days) elapsed without a vendor fix, triggering public advisory release.

Root cause and attack chain

AOTI model packages are archive containers. When AOTIModelPackageLoader extracts a package, it fails to properly sanitize file paths embedded within the archive. An attacker can craft a package containing entries with relative path traversal sequences (../../) or absolute paths, causing extracted files to be written outside the intended extraction directory.

From a defender's perspective, the kill chain looks like this:

  1. Delivery: Victim receives a malicious .pt2 package — via a poisoned model repository, a phishing attachment, a compromised artifact registry, or a supply-chain insertion into an internal model store.
  2. Trigger: Victim (or an automated pipeline running under their credentials) loads the package via torch._inductor AOTI loading APIs. User interaction required — no pre-auth remote trigger exists.
  3. Traversal write: During extraction, attacker-controlled files are written to arbitrary filesystem locations the process can reach: user startup folders, ~/.bashrc / ~/.profile, sitecustomize.py in the Python path, cron directories, systemd user units, LD_PRELOAD targets, or overwriting existing executables/libraries.
  4. Execution: The written payload executes — either immediately (overwriting a file that is subsequently loaded by the same process) or on next logon/process start. Code runs with the privileges of the PyTorch process context.

The critical point for detection engineering: the observable behavior is a Python/PyTorch process writing executable or script content to locations it has no business writing to — persistence directories, user profile configuration files, or paths outside any legitimate temporary extraction root.

Exploitation status

  • In-the-wild exploitation: Not confirmed as of publication.
  • Public PoC: ZDI advisory is public; technical details sufficient to weaponize should be assumed available to motivated actors.
  • CISA KEV: Not listed at time of writing — but do not wait for KEV inclusion to act on a zero-day with a published advisory.
  • Threat outlook: ML supply-chain attacks are an active growth area. Model artifact poisoning via archive extraction bugs is a proven technique class across the ecosystem, and the lag between advisory and patch makes this window dangerous.

Detection & Response

This is a technical threat. The detections below target the two highest-fidelity observable behaviors: (1) Python processes writing to persistence/execution locations outside legitimate extraction paths, and (2) suspicious child process or file-write activity originating from PyTorch/AOTI loading contexts.

Sigma Rules

YAML
---
title: Python Process Writing Executable Content to Persistence Locations
id: 3f8a2b91-7c4d-4e6a-b1f2-9d5c8e7a3b21
status: experimental
description: Detects python/python3 processes writing executables or scripts to persistence-adjacent locations, consistent with directory traversal payload drops from malicious PyTorch AOTI model packages (CVE-2026-136430).
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1057/
  - https://attack.mitre.org/techniques/T1037/
  - https://attack.mitre.org/techniques/T1546/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.persistence
  - attack.t1037
  - attack.t1546
logsource:
  category: file_event
  product: windows
detection:
  selection_process:
    Image|endswith:
      - '\python.exe'
      - '\pythonw.exe'
  selection_target:
    TargetFilename|contains:
      - '\Start Menu\Programs\Startup\'
      - '\Microsoft\Windows\Start Menu\Programs\Startup\'
      - '\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\'
  selection_ext:
    TargetFilename|endswith:
      - '.exe'
      - '.dll'
      - '.bat'
      - '.ps1'
      - '.lnk'
      - '.py'
  condition: all of selection_*
falsepositives:
  - Legitimate Python-based installers or development tooling writing to startup folders (rare)
level: high
---
title: PyTorch Process Spawning Shell or Script Interpreter
id: 8c1d4e72-5b6f-4a3c-9d2e-7f1a4b8c6d35
status: experimental
description: Detects shell or script interpreter processes spawned by python processes loading model artifacts, which may indicate successful exploitation of the AOTIModelPackageLoader directory traversal (CVE-2026-136430).
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1057/
  - https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.execution
  - attack.t1059
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\python.exe'
      - '\pythonw.exe'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\mshta.exe'
      - '\rundll32.exe'
  filter_pip:
    CommandLine|contains:
      - 'pip install'
      - 'setup.py'
      - 'wheel'
  condition: all of selection_* and not filter_pip
falsepositives:
  - ML pipelines invoking subprocesses for compilation (nvcc, build tools)
  - Legitimate pip/setuptools activity
level: medium
---
title: Python Process Writing to Shell Configuration or Python Startup Files
id: 2b7e9f14-3a5d-4c8b-a6e1-4d9c2f7b8e53
status: experimental
description: Detects Python processes modifying shell profiles, Python startup hooks (sitecustomize/usercustomize), or cron/systemd user paths on Linux, consistent with persistence established via archive traversal writes from a malicious PyTorch AOTI package (CVE-2026-136430).
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1057/
  - https://attack.mitre.org/techniques/T1546/004/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.persistence
  - attack.t1546.004
logsource:
  category: file_event
  product: linux
detection:
  selection_process:
    Image|endswith:
      - '/python'
      - '/python3'
      - '/python3.10'
      - '/python3.11'
      - '/python3.12'
  selection_target:
    TargetFilename|contains:
      - '/.bashrc'
      - '/.bash_profile'
      - '/.profile'
      - '/.zshrc'
      - 'sitecustomize.py'
      - 'usercustomize.py'
      - '/etc/cron.d/'
      - '/.config/systemd/user/'
      - '/.config/autostart/'
  condition: all of selection_*
falsepositives:
  - Environment bootstrap scripts in dev containers
  - Legitimate virtualenv or conda activation scripts
level: high

KQL Hunt — Microsoft Sentinel / Defender for Endpoint

The following query hunts for Python processes writing potentially executable or persistence-relevant content to high-risk locations. Run it across a 7-14 day lookback, and tighten the path list to match your environment's legitimate extraction roots.

KQL — Microsoft Sentinel / Defender
let PersistencePaths = dynamic([
  @"\Start Menu\Programs\Startup\",
  @"/etc/cron.d/",
  @"/.bashrc", @"/.bash_profile", @"/.profile", @"/.zshrc",
  @"sitecustomize.py", @"usercustomize.py",
  @"/.config/systemd/user/", @"/.config/autostart/"
]);
let RiskyExtensions = dynamic([".exe", ".dll", ".so", ".py", ".sh", ".bat", ".ps1", ".lnk", ".desktop"]);
DeviceFileEvents
| where TimeGenerated > ago(14d)
| where InitiatingProcessFileName in~ ("python.exe", "pythonw.exe", "python", "python3")
    or InitiatingProcessFileName startswith "python3."
| where FolderPath has_any (PersistencePaths)
    or FileName has_any (RiskyExtensions)
| where FolderPath !has_any (dynamic([@"\site-packages\pip\", @"/tmp/pip-", @"\conda\", @"/opt/conda/"]))
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
          FolderPath, FileName, ActionType, SHA256, InitiatingProcessAccountName
| order by TimeGenerated desc;

For Linux-heavy ML environments ingesting via Syslog/CEF, pair the above with a process-lineage hunt:

KQL — Microsoft Sentinel / Defender
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where InitiatingProcessFileName has_any ("python", "python3")
    or InitiatingProcessFileName startswith "python3."
| where FileName in~ ("sh", "bash", "dash", "zsh", "curl", "wget", "chmod", "crontab", "systemctl", "nc", "ncat")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
          FileName, ProcessCommandLine, AccountName
| order by TimeGenerated desc;

Velociraptor VQL — Endpoint Forensic Hunt

Use this artifact during triage of a host suspected of loading a malicious model package. It enumerates Python processes with shell-like children and recently written artifacts in persistence-adjacent paths.

VQL — Velociraptor
-- Hunt: PyTorch AOTI traversal exploitation artifacts (CVE-2026-136430)
-- Identifies python processes spawning shells/downloaders and recent writes to persistence paths
LET shell_procs = SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE Name =~ '(?i)python'

LET suspicious_children = SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE Ppid in (SELECT Pid FROM shell_procs)
  AND Name =~ '(?i)(sh|bash|dash|zsh|curl|wget|chmod|crontab|systemctl|nc|ncat|cmd|powershell|pwsh)'

SELECT * FROM suspicious_children

-- Secondary: enumerate recently modified files in persistence-relevant locations
LET persistence_globs = '''
/etc/cron.d/**
/home/*/.bashrc
/home/*/.profile
/home/*/.config/systemd/user/**
/home/*/.config/autostart/**
/root/.bashrc
'''

SELECT FullPath, Size, Mtime, Ctime
FROM glob(globs=persistence_globs)
WHERE Mtime > (now() - 1209600)
ORDER BY Mtime DESC

Verification & Hardening Script

With no patch available, your immediate task is inventory and exposure reduction. The following Bash script inventories PyTorch installations, flags AOTI package files on the host, and surfaces recently modified persistence-relevant files for review.

Bash / Shell
#!/usr/bin/env bash
# Security Arsenal - CVE-2026-136430 exposure assessment
# Inventories PyTorch installs, locates AOTI (.pt2) packages, flags suspicious writes

set -euo pipefail

echo "=== [1] PyTorch installations ==="
for py in $(compgen -c | grep -E '^python3?(\.[0-9]+)?$' | sort -u); do
  ver=$("$py" -c 'import torch; print(torch.__version__)' 2>/dev/null || true)
  [ -n "$ver" ] && echo "  $py -> torch $ver ($(command -v $py))"
done

echo "=== [2] AOTI model packages (.pt2) on filesystem ==="
find /home /opt /srv /data /tmp /var/tmp -type f -name '*.pt2' -mtime -90 2>/dev/null | while read -r f; do
  echo "  FOUND: $f ($(stat -c '%y' "$f" 2>/dev/null | cut -d. -f1))"
done

echo "=== [3] Recently modified persistence-relevant files (last 7 days) ==="
find /etc/cron.d /etc/cron.daily /home -maxdepth 4 -mtime -7 \( \
  -name '.bashrc' -o -name '.bash_profile' -o -name '.profile' -o -name '.zshrc' -o \
  -name 'sitecustomize.py' -o -name 'usercustomize.py' -o -path '*/autostart/*' -o \
  -path '*/systemd/user/*' \) 2>/dev/null -printf '  MODIFIED: %p  %TY-%Tm-%Td %TH:%TM\n' | sort

echo "=== [4] Check pip for torch and note upgrade availability ==="
python3 -m pip index versions torch 2>/dev/null | head -5 || \
  echo "  (pip index unavailable - check https://pytorch.org and GitHub security advisories manually)"

echo ""
echo "REMINDER: CVE-2026-136430 is UNPATCHED. Do not load .pt2 packages from untrusted sources."
echo "Run AOTI loading in an unprivileged sandbox/container with read-only mounts outside the extraction dir."

Remediation

There is no vendor patch. Every recommendation below is a compensating control until the PyTorch Foundation ships a fix.

  1. Block untrusted AOTI package loading — effective immediately. Enforce a policy that .pt2 packages are only loaded from internally vetted, hash-verified sources. Pin SHA-256 digests of approved packages in your artifact registry and verify before load.
  2. Sandbox the loader. Run any process that calls AOTI package loading inside a hardened container or sandbox: non-root user, read-only root filesystem, writable scratch space confined to a dedicated extraction directory, no network egress unless required, and seccomp/AppArmor profiles applied. Directory traversal in a properly sandboxed loader writes into an ephemeral, unprivileged filesystem — a dead end for the attacker.
  3. Restrict write reachability. On Linux inference hosts, use systemd sandboxing directives (ProtectHome=true, ProtectSystem=strict, ReadWritePaths=/var/lib/ml-scratch) so that even a successful traversal cannot touch shell profiles, cron, or systemd unit paths.
  4. Pre-extraction inspection. Before loading, inspect archive contents for path traversal entries (../, absolute paths, drive-letter paths). Reject any package whose entries resolve outside the intended extraction root. Treat this as a gate in your CI/CD model promotion pipeline.
  5. Deploy the detections above to your SOC and tune to baseline. The file-write-to-persistence analytics are the highest-fidelity signals; baseline legitimate conda/pip activity first.
  6. Monitor for the patch. Track the ZDI-26-1057 advisory, the PyTorch GitHub security advisories page, and PyTorch release notes. When a fixed version ships, prioritize upgrade across all inference and training hosts and validate the fix with your detection suite before closing the exposure ticket.
  7. Segment ML infrastructure. Inference servers and training clusters should sit in dedicated network segments with strict egress filtering. Post-exploitation value drops sharply when the host cannot reach attacker C2 or internal lateral-movement targets.

Bottom Line

CVE-2026-136430 is a textbook ML supply-chain exposure: a file-format parsing flaw in a component that exists specifically to consume externally produced artifacts. The user-interaction requirement does not meaningfully reduce risk in environments where loading model packages is routine, automated behavior. Until PyTorch ships a fix, your defense is sandboxing the loader, gating package provenance, and hunting for the traversal's unavoidable artifact — a Python process writing executable content where it does not belong.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.