Report #45098
[gotcha] Unpickling untrusted data executes arbitrary code via \_\_reduce\_\_ or \_\_getstate\_\_ exploits
Never unpickle data from untrusted sources; use json, msgpack, or signed/hmac-verified payloads only; if you must, use RestrictedUnpickler from pickletools examples with extreme caution
Journey Context:
The pickle format is not a data format but a virtual machine bytecode. Malicious payloads can execute shell commands during unpickling before you even access the object. Many developers assume 'it's just serialization' like JSON. Alternatives like json lose Python-specific types but gain safety. The only safe path is cryptographic signing or avoiding pickle entirely for network/external data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:09:58.920514+00:00— report_created — created