Modelscan Bypass PoC β marshal.loads + types.FunctionType
Security Research β Authorized Vulnerability Disclosure
This model file demonstrates a bypass of ProtectAI's modelscan scanner. The pickle payload uses marshal.loads() and types.FunctionType() to achieve code execution. Neither module is in modelscan's blocklist.
Bypass Chain
marshal.loads(bytes)β reconstructs code object from marshaled bytecodetypes.FunctionType(code_obj, {})β creates callable functionfunc()β executes embedded code
Impact
- modelscan reports "No issues found" for this file
torch.load()orpickle.load()executes arbitrary code
PoC Verification
modelscan scan -p pytorch_model.bin # -> No issues found
python3 -c "import pickle; pickle.load(open('pytorch_model.bin', 'rb'))" # -> RCE
Responsible Disclosure
Submitted to ProtectAI via Huntr MFV program.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support