Downloads · 30 days
0
jeikei97/modelscan-joblib-gadget-chain-bypass
modelscan-joblib-gadget-chain-bypass is a machine learning model from jeikei97. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a proof of concept for a scanner bypass in .joblib model files.
Downloads · 30 days
0
Access
Public
Updated Jul 16, 2026
Repo size
94 B
Likes
0
Public
Click a slice to open those files.
.py3.9 KB · 45%
From the Hugging Face model README
This repository contains a proof of concept for a scanner bypass in .joblib model files.
The open-source protectai/modelscan pickle scanner extracts imported globals and compares them against a static blacklist. A malicious pickle gadget chain can still reach dangerous behavior by composing apparently safe globals.
The included .joblib payload uses only:
operator.methodcallerimportlib.import_moduleAt deserialization time, those globals compose into the equivalent of:
operator.methodcaller("system", "touch g")(importlib.import_module("os"))
This means joblib.load() executes the payload even though modelscan reports zero issues and zero errors.
The main PoC file is:
artifacts/gadget.joblibThe payload is harmless. When loaded, it creates a local marker file:
JOBLIB_MARKER.txtartifacts/gadget.joblibartifacts/reproduce_output.txtartifacts/sha256sums.txtreproduce.pyjoblib: 1.5.2modelscan: protectai/modelscan @ 61fcec9c2a37c24c1fb12d84ede30fe248a364bdRun:
python reproduce.py --modelscan-path /path/to/modelscan
If modelscan is already installed in your environment, --modelscan-path is optional.
Expected results:
operator.methodcaller and importlib.import_modulepickle.loads(...) executes the payloadjoblib.load(...) executes the payloadmodelscan returns zero issues and zero errorsRun:
python reproduce.py --build --modelscan-path /path/to/modelscan
This regenerates artifacts/gadget.joblib and reruns the verification steps.
From artifacts/reproduce_output.txt:
payload_globals: ['operator.methodcaller', 'importlib.import_module']pickle.loads(...) creates the marker filejoblib.load(...) creates the marker filemodelscan_issue_count: 0modelscan_errors: []This is a practical semantic scanner bypass for a supported model format:
.joblibmodelscan parses it successfullyos.system through gadget composition