Skip to main content
Challenges Pickle trap: static analysis of opcodes
Artificial Intelligence Easy ML security: analysing a malicious Python pickle model with pickletools without loading it Solves: 3

Pickle trap: static analysis of opcodes

Author: CyberSamSU
Points
20

The model.pkl file downloaded from a public model repository is presented as an ordinary PyTorch OrderedDict weights dictionary (state_dict). A security system suspects that the file contains an untrusted deserialization trap (__reduce__).

WARNING: Do NOT LOAD the file with pickle.load() or torch.load()! Analyse it only statically, using the pickletools module from the Python standard library.

Between the layers inside the file, a REDUCE opcode that performs a posix.system (or os.system) call has been placed, and it runs a command string of the form echo <hex> > /tmp/.c. Note that among the ordinary dictionary strings there are also decoy fake flags and strings (without a REDUCE call). Decode the <hex> string passed to the real REDUCE opcode and find the BAYROQ{PICKLE_TUZOQ_...} flag (the last 16 characters are lowercase hex).

Attached files
model.pkl Log in to download
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −2 pts Log in
Hint 2 −4 pts Log in
Hint 3 −6 pts Log in
To submit a flag, log in.

First solvers

1. Mirjaxon Qaxxarov 24.11.2026
2. Odam 25.11.2026
3. Doston Allayarov 28.11.2026