Downloads · 30 days
0
romandaripper/picklescan-marshal-functiontype-bypass-poc
picklescan-marshal-functiontype-bypass-poc is a machine learning model from romandaripper. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Proof-of-concept accompanying a huntr Model File Vulnerabilities (MFV) report against picklescan 1.0.5.
Downloads · 30 days
0
Access
Public
Updated Jul 30, 2026
Repo size
240 B
Likes
0
Public
Click a slice to open those files.
.md2 KB · 44%
From the Hugging Face model README
marshal.loads + types.FunctionTypeProof-of-concept accompanying a huntr Model File Vulnerabilities (MFV) report against
picklescan 1.0.5.
This is a security research artifact. The payload is deliberately harmless: it writes a
local file named cyfra_marker containing EXEC_OK. It does not touch the network, delete
anything, or write outside the working directory.
picklescan blocks types.CodeType ("can construct arbitrary code objects") but:
marshal is absent from the blocklist entirely — and marshal.loads(bytes) returns a
code object, so the CodeType entry is bypassable by design.types.FunctionType is not blocked, so that code object can be turned into a callable
and invoked through a second REDUCE.Result: a pickle that executes arbitrary code on a plain pickle.load() is reported as merely
suspicious, with Infected files: 0 and Dangerous globals: 0.
pip install picklescan==1.0.5
python generate_poc.py
python -m picklescan.cli --path chain.pkl
# Scanned files: 1
# Infected files: 0
# Suspicious globals: 2
# Dangerous globals: 0 <-- not flagged as dangerous
python -c "import pickle; pickle.load(open('chain.pkl','rb'))"
cat cyfra_marker # EXEC_OK -> arbitrary code executed
No custom loader, no container trick, no attacker-controlled prerequisite: the standard
library loader runs it. For comparison, fickling 0.1.12 flags the identical file as
LIKELY_OVERTLY_MALICIOUS, showing detection is feasible.
marshal (loads/load) to _unsafe_globals as dangerous.types.FunctionType (and consider types.MethodType) alongside CodeType.Cyfra Tech Solutions (Roman Arce Bran), Costa Rica.