โ ๏ธ Security PoC โ NOT a usable model
Proof-of-concept malicious .joblib files for a huntr
"Model Format Vulnerability" submission (Protect AI / Palo Alto Prisma AIRS).
They achieve arbitrary code execution on joblib.load() while being reported
clean by Protect AI ModelScan. Published only for responsible-disclosure
reproduction. Do not load them on a machine you care about.
What it demonstrates
joblib.load() deserializes via pickle, so an object's __reduce__ runs code
on load. ModelScan's pickle scanner is a module-name denylist; choosing a
code-execution gadget whose module is not on that denylist yields RCE that
ModelScan does not flag.
| File | Gadget | ModelScan |
|---|---|---|
poc.joblib |
pydoc.pipepager(text, cmd) โ subprocess.Popen(cmd, shell=True) |
0 issues |
poc2_cprofile.joblib |
cProfile.run(stmt) โ exec(stmt) |
0 issues |
naive_os_system.joblib |
os.system(cmd) (contrast) |
CRITICAL โ detected |
The two gadgets show the bypass is structural: patching one module does not close the class. The proof command is non-destructive โ it only writes a marker file.
Reproduce
python -m pip install joblib modelscan
python load_poc.py poc.joblib # -> writes joblib_poc_pwned.txt (RCE)
modelscan -p poc.joblib -r json # -> total_issues: 0 (bypass)
modelscan -p naive_os_system.joblib # -> CRITICAL (control is caught)
Files
poc.joblibโ RCE viapydoc.pipepager, bypasses ModelScanpoc2_cprofile.joblibโ RCE viacProfile.run, bypasses ModelScannaive_os_system.joblibโ control payload ModelScan flags CRITICALmake_joblib_poc.pyโ regenerates all three deterministicallyload_poc.pyโ minimal loader proving execution