Skip to content
Submit incident
AII-1002-69761
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.

Picklescan fails to flag pip.main() as unsafe, allowing RCE bypass

Picklescan, a Python security scanner for detecting unsafe operations in pickled objects, failed to flag pip.main() as a dangerous function before version 0.0.21, allowing attackers to craft malicious pickled objects that bypass security checks and achieve remote code execution by installing arbitrary packages from PyPI or GitHub.", <parameter name="event_date">null

26 February 2025 Β· picklescan Β· Security and cyberattacks
26 February 2025
AII-1002-697612 sources ↓
Quick facts
Category
Security and cyberattacks
Source
github.com
Date
26 February 2025
Drafted by
Raidu Incident Detection

What happened

Picklescan before version 0.0.21 does not treat pip as an unsafe global, allowing attackers to craft malicious pickled objects that call pip.main() to install arbitrary PyPI packages while evading the scanner's security checks.

The vulnerability uses pickle's reduce method to invoke pip.main() with arguments to install a malicious package hosted on PyPI or GitHub, which then executes arbitrary code via setup.py or entry points during installation.

Reported impact

An attacker can bypass Picklescan's security checks and achieve remote code execution on systems that deserialize the malicious pickle file.

The attack enables supply chain compromise by distributing infected pickle files in machine learning models, APIs, or saved Python objects.

Index analysis

The vulnerability is classified as an incomplete list of disallowed inputs (CWE-184), allowing an unsafe function (pip.main) to escape static analysis detection.

Governance controls

Picklescan was patched by adding pip to the list of restricted globals, marking pip.main as a Dangerous operation in subsequent versions.

Classification

Category
Security and cyberattacks
Industry
Digital security
Harm status
Potential harm
Intent
Unintentional
Timing
Post-deployment
Harmed
General public
AI systems
picklescan

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

github.com
https://github.com/mmaitre314/picklescan/commit/78ce704227c51f070c0c5fb4b466d92c62a7aa3d
sonatype.com
https://www.sonatype.com/security-advisories/cve-2025-1716