Skip to content

GHSA-vqmv-47xg-9wpr Picklescan missing detection when calling pty.spawn

HighCVSS 8.9
Published
Updated
Exploit status
No public exploit known

Description

Summary

Using pty.spawn, which is a built-in python library function to execute arbitrary commands on the host system.

Details

The attack payload executes in the following steps:
First, the attacker craft the payload by calling to pty.spawn function in the __reduce__ method. Then the victim attempts to use picklescan to scan the pickle file for issues and sees this -

----------- SCAN SUMMARY -----------
Scanned files: 1
Infected files: 0
Dangerous globals: 0

The victim proceeds to load the pickle file and execute attacker-injected arbitrary code.

PoC

class PtyExploit:
  def __reduce__(self):
    return (pty.spawn, (["/bin/sh", "-c", "id; exit"],))

Impact

Who is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models.
What is the impact? Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded.
Supply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.

Collaborators

https://github.com/ajohnston9
https://github.com/geo-lit

Upgrade path

1 package: 1 fixed.

PackageAffectedFixed inStatus
pypi picklescan(PyPI) < 0.0.33; = 0.0.1; = 0.0.2; = 0.0.3 +29 more 0.0.33 Fixed

Affected products

ProductAffected versionsFixed in
pypi picklescan(PyPI) < 0.0.33 0.0.33
pypi picklescan(PyPI) = 0.0.1 No fix listed
pypi picklescan(PyPI) = 0.0.10 No fix listed
pypi picklescan(PyPI) = 0.0.11 No fix listed
pypi picklescan(PyPI) = 0.0.12 No fix listed
pypi picklescan(PyPI) = 0.0.13 No fix listed
pypi picklescan(PyPI) = 0.0.14 No fix listed
pypi picklescan(PyPI) = 0.0.15 No fix listed
pypi picklescan(PyPI) = 0.0.16 No fix listed
pypi picklescan(PyPI) = 0.0.17 No fix listed
pypi picklescan(PyPI) = 0.0.18 No fix listed
pypi picklescan(PyPI) = 0.0.19 No fix listed
pypi picklescan(PyPI) = 0.0.2 No fix listed
pypi picklescan(PyPI) = 0.0.20 No fix listed
pypi picklescan(PyPI) = 0.0.21 No fix listed
pypi picklescan(PyPI) = 0.0.22 No fix listed
pypi picklescan(PyPI) = 0.0.23 No fix listed
pypi picklescan(PyPI) = 0.0.24 No fix listed
pypi picklescan(PyPI) = 0.0.25 No fix listed
pypi picklescan(PyPI) = 0.0.26 No fix listed
pypi picklescan(PyPI) = 0.0.27 No fix listed
pypi picklescan(PyPI) = 0.0.28 No fix listed
pypi picklescan(PyPI) = 0.0.29 No fix listed
pypi picklescan(PyPI) = 0.0.3 No fix listed
pypi picklescan(PyPI) = 0.0.30 No fix listed
Show 8 more
ProductAffected versionsFixed in
pypi picklescan(PyPI) = 0.0.31 No fix listed
pypi picklescan(PyPI) = 0.0.32 No fix listed
pypi picklescan(PyPI) = 0.0.4 No fix listed
pypi picklescan(PyPI) = 0.0.5 No fix listed
pypi picklescan(PyPI) = 0.0.6 No fix listed
pypi picklescan(PyPI) = 0.0.7 No fix listed
pypi picklescan(PyPI) = 0.0.8 No fix listed
pypi picklescan(PyPI) = 0.0.9 No fix listed

References