You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
This repository contains a deliberately malicious .joblib model published for authorized security research / coordinated disclosure (huntr / ProtectAI). Access is gated and manually reviewed. Do not load this file on any system you care about.
Log in or Sign Up to review the conditions and access this model content.
β οΈ Security PoC β malicious .joblib (ModelScan bypass β RCE on load)
Deliberately malicious .joblib (pickle) model for coordinated disclosure.
What it demonstrates
ModelScan's pickle scanner (PickleUnsafeOpScan, used for .joblib/.pkl/
.dill) decides severity from a module blocklist (os, posix, subprocess,
builtins.eval/exec, runpy, pty, shutil, β¦). The matching logic flags a
pickle GLOBAL only if its module is on that list β anything else passes:
for severity_name in severities:
if global_module not in settings["unsafe_globals"][severity_name]:
continue # module not blocklisted -> not flagged
...
# severity stays None -> NOT reported
It is a blocklist, not an allowlist. The gadget pydoc.pipepager(text, cmd)
runs cmd through os.popen() β arbitrary command execution, and pydoc is
not on the blocklist. So a .joblib carrying this gadget scans clean yet
executes code on joblib.load(). (cProfile.run, etc. work the same way.)
Target format
.joblib (also .pkl / .pickle / .dill) β pickle stream. The malicious
GLOBAL is ('pydoc','pipepager').
Files
malicious_model.joblibβ looks like a serialized estimator; RCE viapydoc.pipepagercontrol_model.joblibβ same attack viaos.system(ModelScan flags CRITICAL)build_joblib_poc.py/verify_joblib.py/trigger_joblib.py
Reproduce
pip install joblib modelscan
modelscan -p malicious_model.joblib # -> No issues found π (bypass)
modelscan -p control_model.joblib # -> CRITICAL 'system' from 'posix' (control)
python trigger_joblib.py # -> creates /tmp/RCE_FROM_JOBLIB_<user>_on_<host>
Evidence
1. ModelScan bypass β pydoc.pipepager model is clean; os.system control is CRITICAL:
2. RCE on load β loading the "clean" model runs a shell command (marker filename
embeds the command output, so execution is shown with ls alone):
Remediation
A module blocklist cannot enumerate every RCE primitive in the stdlib. ModelScan
should move to an allowlist of known-safe globals for pickle-based formats
(flag everything else), and/or refuse to deserialize on REDUCE/GLOBAL to
modules outside a vetted set. Note pydoc, cProfile, profile, timeit,
code, etc. all expose code-execution primitives not currently flagged.

