sdk/python/Command Execution

Command Execution

subprocess, os — command injection sinks

All 10Source: 1Sink: 6Sanitizer: 1
PyCffi
cffi

cffi calls C libraries without writing a C extension. FFI.dlopen() loads a shared library at runtime — code-execution sink on user-controlled path. FFI.cdef parses C declarations — neutral unless the definitions are user-controlled.

1 sink2 methods
PyCtypes
ctypes

The ctypes module for calling C libraries. LoadLibrary / CDLL on user-controlled paths loads arbitrary code — code-execution sink. String pointer operations can also be memory-safety findings.

3 sinks3 methods
PyDocker
docker

The docker SDK. DockerClient.containers.run with privileged=True is a container-escape finding. volumes mounting /var/run/docker.sock into the container grants full Docker daemon access.

1 sink2 methods
PyFcntl
fcntl

Python stdlib module — fcntl. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

4 methods
PyOS
os

The os standard library module. os.system() and os.popen() always invoke a shell and are injection sinks. os.exec* variants avoid the shell but are still sinks for the program path. Environment accessors (os.environ, os.getenv) are sources.

2 sources5 sinks7 methods
PyPexpect
pexpect

pexpect spawns interactive subprocesses with expect/respond patterns. spawn(cmd, ...) on user-controlled cmd is a command-injection sink, equivalent to subprocess with shell=True.

2 sinks2 methods
PyPty
pty

Python stdlib module — pty. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

10 methods
PyShlex
shlex

The shlex module provides shell-compatible tokenization and quoting. shlex.quote is the canonical sanitizer for shell=True command construction. shlex.split is safer than splitting yourself, but quote is what protects against shell-metacharacter injection.

3 sanitizers3 methods
PySignal
signal

Python stdlib module — signal. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

10 methods
PySubprocess
subprocess

The subprocess standard library module for spawning child processes. Most call APIs accept either a list[str] (safe) or a string with shell=True (command-injection sink when the string contains user input).

5 sinks5 methods