Summary
Fickling, a Python pickle decompiler and static analyzer, contained a detection-bypass issue related to incomplete handling of objects constructed via the builtins module.
Under certain conditions, malicious pickle payloads leveraging builtins could evade Fickling's analysis, causing unsafe deserialization patterns to go undetected in security reviews or CI pipelines.
Affected context
This vulnerability affects workflows and tools that rely on Fickling (prior to version 0.1.7) to statically analyze Python pickle payloads for unsafe deserialization behavior.
It is most relevant where:
- Pickle files are analyzed or scanned as part of security review, code audit, or CI/CD checks
- Trust decisions about pickle safety are based primarily on Fickling's output
- Attackers can craft or influence pickle data, including references through
builtins
Exploit preconditions
- Attack surface: Any pipeline, tool, or security process that uses Fickling to determine whether a pickle is safe or malicious.
- Required access: Ability to submit, store, or modify pickle payloads that will be analyzed by Fickling (e.g., data uploads, artifact repositories, or code review inputs).
- Trigger point: Running Fickling's decompiler or static analyzer on a malicious pickle that relies on
builtins-based constructs. - Why exploitation is possible: Fickling's analysis did not fully account for objects or execution paths originating from
builtins, allowing certain attacker-controlled constructs to bypass its unsafe deserialization detection logic.
Why this happens
The underlying issue is a detection blind spot within an unsafe deserialization analyzer rather than a direct runtime deserialization bug in Fickling itself.
Fickling attempts to reason about Python pickle opcodes and object graphs to flag potentially dangerous constructs associated with CWE-502: Unsafe Deserialization.
However, its analysis model was incomplete for payloads that leveraged the builtins module, leading to misclassification or non-detection of patterns that could instantiate sensitive or dangerous objects at runtime.
Conceptually, this is an instance of an incomplete security rule-set: the analyzer trusted its own model of what is dangerous, but that model did not fully represent all relevant deserialization behaviors, especially those routed through builtins.
Potential impact
- Malicious pickle payloads may appear benign when analyzed by Fickling-based tools.
- Security teams could overlook unsafe deserialization paths in applications that load attacker-influenced pickle data.
- CI/CD pipelines relying on Fickling may pass artifacts containing dangerous pickle constructs.
- Organizations may develop a false sense of security about the safety of pickles that exploit
builtins-based behavior.
General mitigation guidance
Mitigation focuses on reducing dependence on a single analysis tool and hardening deserialization practices:
- Treat Fickling (and similar tools) as advisory, not definitive, especially for risk decisions around untrusted pickle data.
- Avoid deserializing untrusted or semi-trusted pickles; prefer safer, structured formats (e.g., JSON, MessagePack, or custom schemas) where feasible.
- Constrain runtime environments that must handle pickle data using least privilege, sandboxing, and restricted imports.
- Introduce an explicit trust boundary for pickle usage: only accept pickles from well-defined, authenticated sources and avoid mixing with user-controlled content.
- Combine multiple analysis approaches (manual review, additional static/dynamic checks) for high-risk deserialization paths, rather than relying solely on one static analyzer.
How teams detect issues like this
To identify and manage this class of issue:
- Review security tooling configurations to understand where Fickling is used as a gate for pickle safety.
- Perform targeted code review for any Python components that call
pickle.load,pickle.loads, or similar APIs for untrusted or externally supplied data. - Use static analysis rules or grep-based searches to flag direct or indirect uses of pickle deserialization and cross-check them against Fickling's findings.
- Incorporate policy checks that prevent merging or deploying code that deserializes untrusted pickles, independent of analyzer output.
- Periodically validate security tools against known-bad test cases to detect blind spots and regressions in detection logic.

