Skip to content

[Security] Sandbox escape via ctypes in LocalPythonExecutorΒ #2094

@rishavkumarthapa01-sketch

Description

Summary

LocalPythonExecutor maintains a DANGEROUS_MODULES blocklist but ctypes
is absent, allowing direct libc.system() calls that bypass all sandbox
restrictions.

Vulnerable code

local_python_executor.py L130-L141 β€” ctypes not in DANGEROUS_MODULES

Suggested fix

Add ctypes to DANGEROUS_MODULES:

DANGEROUS_MODULES = [
    "builtins", "io", "multiprocessing", "os", "pathlib",
    "pty", "shutil", "socket", "subprocess", "sys",
    "ctypes",  # add this
]

Reported via

huntr.com bug bounty program (report pending review)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions