Details
Expected output
[*] fickling severity : LIKELY_SAFE
[*] fickling is_safe : True
[+] fickling rates the pickle as LIKELY_SAFE <-- bypass confirmed
[*] Calling pickle.loads() to simulate victim loading the file...
[+] Incoming TCP connection received from ('127.0.0.1', 58412)
[+] FULL BYPASS CONFIRMED: outbound connection made while fickling reported LIKELY_SAFE
Tested on Python 3.11.1, Windows. Not OS-specific.
Impact
An attacker distributing a malicious pickle file (e.g. a crafted ML model checkpoint)
can silently:
- Enumerate victims -- receive a TCP callback every time the pickle is loaded, including in sandboxed environments
- Exfiltrate host identity -- victim IP, hostname (via SMTP EHLO), and service banners are sent to the attacker's server
- Probe internal services (SSRF) -- if the victim host can reach internal SMTP relays, IMAP stores, or FTP servers, the pickle probes those services on the attacker's behalf
- Establish a covert channel -- protocol handshakes carry attacker-controlled bytes through a channel fickling explicitly labels safe
The is_likely_safe() helper (fickling/analysis.py:468-474) and the --check-safety
CLI flag both gate on severity == LIKELY_SAFE. This bypass clears that gate
completely with zero warnings.
Suggested fix
Walk statement.value before the break so variables referenced only in the result
assignment are correctly counted as used:
# fickling/fickle.py:1183 -- suggested fix
if (
len(statement.targets) == 1
and isinstance(statement.targets[0], ast.Name)
and statement.targets[0].id == "result"
):
# scan RHS before breaking so variables used only here are marked as used
for node in ast.walk(statement.value):
if isinstance(node, ast.Name):
used.add(node.id)
break
This is the same pattern already used for every other statement in the loop
(lines 1200-1203). All 55 non-torch tests pass with this fix applied.
---
Affected versions
All releases including v0.1.7 (latest). Confirmed on latest master as of
2026-02-19. Root cause 1 patched in PR #233 (master only, not yet released).
Root cause 2 unpatched as of this report.
Reporter
Anmol Vats