Registry / serialization / fickling

fickling

JSON →
library0.1.12pypypi✓ verified 24d ago

Fickling is a static analyzer and interpreter for Python pickle data. It identifies dangerous modules, functions, and attributes used within pickle files to prevent arbitrary code execution vulnerabilities. The current version is 0.1.10, and it maintains an active release cadence, frequently publishing security updates and expanded blocklists.

pip install fickling
INSTALL
IMPORT
SIG · FICKLING
F
fickling
serializationpythonv0.1.12
Install
1.6s avg
Import
114ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.046s · 18.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.045s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

analyze_pickle
from fickling import analysis
from fickling.analysis import analyze_pickle
check_safety
from fickling import check_safety
load
from fickling import load

This quickstart demonstrates how to use `fickling.analysis.analyze_pickle` to check both benign and potentially malicious pickle data. It shows how to catch `UnsafeError` and iterate through detected violations.

import pickle from fickling.analysis import analyze_pickle from fickling.errors import UnsafeError # Create a benign pickle (for demonstration) class MyObject: def __init__(self, name): self.name = name obj = MyObject("safe_data") benign_pickled_data = pickle.dumps(obj) # Analyze the pickled data try: print("\n--- Analyzing benign pickle ---") results = analyze_pickle(benign_pickled_data) if results.is_safe(): print("Pickle is safe. No violations found.") else: print("Pickle is potentially unsafe. Violations:") for violation in results.violations: print(f"- {violation.severity.name}: {violation.message}") except UnsafeError as e: print(f"Analysis detected an unsafe pickle: {e}") except Exception as e: print(f"An unexpected error occurred during analysis: {e}") # Example of a potentially unsafe pickle (e.g., using os.system) # NOTE: Do NOT run this with untrusted data in production! # This is purely illustrative of what Fickling detects. class MaliciousObject: def __reduce__(self): return (getattr(os, 'system'), ('echo malicious command executed!',)) import os malicious_obj = MaliciousObject() unsafe_pickled_data = pickle.dumps(malicious_obj) # Analyze the potentially unsafe pickled data try: print("\n--- Analyzing potentially unsafe pickle ---") results = analyze_pickle(unsafe_pickled_data) if results.is_safe(): print("Pickle is safe. No violations found.") else: print("Pickle is potentially unsafe. Violations:") for violation in results.violations: print(f"- {violation.severity.name}: {violation.message}") except UnsafeError as e: print(f"Analysis detected an unsafe pickle: {e}") except Exception as e: print(f"An unexpected error occurred during analysis: {e}")
fickling --version
Debug
Known issues
breakingPython 3.9 is no longer supported; the minimum required version is now Python 3.10.
fix
Upgrade your Python environment to 3.10 or newer to use `fickling` versions 0.1.8 and above.
affects: >=0.1.8
breakingCLI exit codes have changed to follow ClamAV conventions: `0` for clean, `1` for unsafe, and `2` for errors.
fix
Update any scripts or automation that rely on `fickling`'s command-line interface to check the new exit code scheme.
affects: >=0.1.8
breakingMalformed pickle data now raises `fickling.errors.InterpretationError` instead of `ValueError`.
fix
Update exception handling blocks to catch `fickling.errors.InterpretationError` when processing potentially malformed pickle data.
affects: >=0.1.8
gotchaThe internal blocklist of unsafe modules, functions, and attributes has been significantly expanded across various versions to address new bypasses. Older versions may be vulnerable to unpickling attacks that newer versions effectively detect.
fix
Always use the latest version of `fickling` to benefit from the most up-to-date security protections and expanded detection capabilities.
affects: <0.1.10
gotcha`torch` is an optional dependency. If you intend to analyze PyTorch models, you must install `fickling[pytorch]` or `torch` separately, as it is not included in the base installation.
fix
Install with `pip install fickling[pytorch]` if you need PyTorch analysis capabilities.
affects: >=0.1.3
Upgrade
Version history
0.1.12latest on PyPI · released Jun 26, 2026
Audit
Dependencies
torchoptionalRequired for analyzing PyTorch model pickles.
Agent activity
24 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources