Junglewise Threat Intelligence

PickleScan arbitrary code execution via pty.spawn bypass

Severity: high · CVSS 8.8 · Published 2026-06-17

Technologies: picklescan (PyPI). Vendors: PyPI.

Executive brief

PickleScan is a security tool used to scan Python 'pickle' files and AI models for malicious code. A vulnerability was found where the tool fails to block a specific command (pty.spawn), allowing attackers to hide malicious code inside files that the scanner incorrectly marks as safe. If a user processes a specially crafted file, an attacker could take complete control of their computer.

Technical details

PickleScan before version 0.0.33 contains a protection mechanism failure (CWE-693) due to an incomplete 'unsafe globals' blocklist. Specifically, the 'pty.spawn' function was not categorized as dangerous, allowing it to be executed during the unpickling process if a user scans a malicious file. An attacker can exploit this by crafting a pickle payload (often embedded in PyTorch models or ZIP archives) that uses pty.spawn to execute arbitrary shell commands. The vulnerability is triggered when PickleScan processes the malicious file, leading to arbitrary code execution (ACE) with the privileges of the user running the scanner. The issue is resolved in version 0.0.33 by adding 'pty' to the internal _unsafe_globals list.

Affected products

  • mmaitre314 picklescan < 0.0.33

Timeline

  • 2025-12-26: advisory: Original GHSA-hgrh-qx5j-jfwx published
  • 2026-06-17: disclosed: CVE-2025-71322 published
  • 2026-06-18: other: Duplicate advisory GHSA-5gp7-4733-2w2v withdrawn

References

Related threats