Modelscan Bypass: code.InteractiveInterpreter + operator.methodcaller
Summary
This model file bypasses ProtectAI modelscan 0.7.6 (latest) scanner while achieving arbitrary code execution via Python's code.InteractiveInterpreter module combined with operator.methodcaller.
Bypass Chain
code.InteractiveInterpreter()โ creates a Python interactive interpreter instanceoperator.methodcaller("runsource", PAYLOAD)โ creates a callable that invokes.runsource()with arbitrary Python code- Chain executes:
interp.runsource(payload)โ arbitrary code execution
Why It Works
codemodule is NOT in modelscan'sunsafe_globalsblocklistoperator.methodcalleris NOT blocked (onlyoperator.attrgetteris blocked)InteractiveInterpreter.runsource()callscompile()thenexec()internally- modelscan only checks module+function pairs against its blocklist
Modelscan Result
Impact
Full arbitrary code execution on model load via pickle.load() or torch.load().
Affected
modelscan 0.7.6 (latest on PyPI as of 2026-04-10)
Responsible Disclosure
Submitted to Huntr for ProtectAI review.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support