You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

ModelScan Bypass PoC โ€” codeop.compile_command

Security research for responsible disclosure via Huntr MFV program.

Vulnerability

codeop.compile_command is not in modelscan's unsafe_globals blocklist. When a pickle file containing this global is scanned by modelscan, it reports "No issues found." However, loading the file with pickle.loads() / torch.load() triggers compiles arbitrary Python code string to code object. Combined with types.FunctionType, achieves full RCE..

Impact

  • Severity: HIGH
  • Effect: compiles arbitrary Python code string to code object. Combined with types.FunctionType, achieves full RCE.

Bypass Class

builtins.compile is blocked but codeop.compile_command (which wraps compile()) is not. The returned code object can be wrapped in types.FunctionType(code, {}) to create and execute an arbitrary function.

Reproduction

pip install modelscan
modelscan scan -p bypass_poc.pkl
# Output: "No issues found!"
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support