Fickling has missing detection for marshal.loads and types.FunctionType in unsafe modules list
Description
Fickling is a Python pickling decompiler and static analyzer. Versions prior to 0.1.6 are missing marshal and types from the block list of unsafe module imports. Fickling started blocking both modules to address this issue. This allows an attacker to craft a malicious pickle file that can bypass fickling since it misses detections for types.FunctionType and marshal.loads. A user who deserializes such a file, believing it to be safe, would inadvertently execute arbitrary code on their system. This impacts any user or system that uses Fickling to vet pickle files for security issues. The issue was fixed in version 0.1.6.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
ficklingPyPI | < 0.1.6 | 0.1.6 |
Affected products
1- Range: master, v0.0.1, v0.0.2, …
Patches
14e34561301bdAdd marshal and types to unsafe modules
2 files changed · +48 −0
fickling/fickle.py+2 −0 modified@@ -875,6 +875,8 @@ def unsafe_imports(self) -> Iterator[ast.Import | ast.ImportFrom]: "sys", "builtins", "socket", + "marshal", + "types", ): yield node elif "eval" in (n.name for n in node.names):
test/test_bypasses.py+46 −0 added@@ -0,0 +1,46 @@ +import marshal +from unittest import TestCase + +import fickling.fickle as op +from fickling.analysis import Severity, check_safety +from fickling.fickle import Pickled + + +class TestBypasses(TestCase): + # https://github.com/trailofbits/fickling/security/advisories/GHSA-565g-hwwr-4pp3 + def test_missing_marshal_and_types(self): + code = compile('import os\nos.system("id")', "<string>", "exec") + opcodes = Pickled( + [ + op.Proto(4), + op.Frame(0), + op.ShortBinUnicode("marshal"), + op.ShortBinUnicode("loads"), + op.StackGlobal(), + op.Memoize(), + op.BinGet(0), + op.ShortBinBytes(marshal.dumps(code)), + op.TupleOne(), + op.Reduce(), + op.Memoize(), + op.ShortBinUnicode("types"), + op.ShortBinUnicode("FunctionType"), + op.StackGlobal(), + op.Memoize(), + op.BinGet(2), + op.BinGet(1), + op.EmptyDict(), + op.TupleTwo(), + op.Reduce(), + op.Memoize(), + op.BinGet(3), + op.EmptyTuple(), + op.Reduce(), + op.Memoize(), + op.ShortBinUnicode("gottem"), + op.Build(), + op.Stop(), + ] + ) + + self.assertGreater(check_safety(opcodes).severity, Severity.LIKELY_SAFE)
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-565g-hwwr-4pp3ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-67747ghsaADVISORY
- github.com/trailofbits/fickling/commit/4e34561301bda1450268d1d7b0b2b151de33b913ghsax_refsource_MISCWEB
- github.com/trailofbits/fickling/pull/186ghsax_refsource_MISCWEB
- github.com/trailofbits/fickling/releases/tag/v0.1.6ghsax_refsource_MISCWEB
- github.com/trailofbits/fickling/security/advisories/GHSA-565g-hwwr-4pp3ghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.