Описание
Fickling vulnerable to use of ctypes and pydoc gadget chain to bypass detection
Fickling's assessment
pydoc and ctypes were added to the list of unsafe imports (https://github.com/trailofbits/fickling/commit/b793563e60a5e039c5837b09d7f4f6b92e6040d1).
Original report
Summary
Both ctypes and pydoc modules arent explictly blocked. Even other existing pickle scanning tools (like picklescan) do not block pydoc.locate. Chaining these two together can achieve RCE while the scanner still reports the file as LIKELY_SAFE
Details
Import: GLOBAL pydoc locate (Allowed). Resolution: Call locate('ctypes.windll.kernel32.WinExec'). Execution: Call the result with (b'calc.exe', 1).
To bypass the unused variable check an exception object is used, on the assumption that Exception would not be blocked in the future as it is a benign builtin
PoC
What fickling sees
Ссылки
- https://github.com/trailofbits/fickling/security/advisories/GHSA-5hvc-6wx8-mvv4
- https://nvd.nist.gov/vuln/detail/CVE-2026-22608
- https://github.com/trailofbits/fickling/pull/195
- https://github.com/trailofbits/fickling/commit/b793563e60a5e039c5837b09d7f4f6b92e6040d1
- https://github.com/trailofbits/fickling/commit/d0b00d584afb5c58e38991cd544cb3889de90db6
- https://github.com/trailofbits/fickling/blob/977b0769c13537cd96549c12bb537f05464cf09c/test/test_bypasses.py#L145
- https://github.com/trailofbits/fickling/releases/tag/v0.1.7
Пакеты
fickling
<= 0.1.6
0.1.7
Связанные уязвимости
Fickling is a Python pickling decompiler and static analyzer. Prior to version 0.1.7, both ctypes and pydoc modules aren't explicitly blocked. Even other existing pickle scanning tools (like picklescan) do not block pydoc.locate. Chaining these two together can achieve RCE while the scanner still reports the file as LIKELY_SAFE. This issue has been patched in version 0.1.7.