run

python · subprocess
sink✓ Reviewed · 2026-09-04
RoleSink
WeaknessCWE-78
WatchesArgument[0]
Kindcommand-injection
Confidencehigh
Corroboration3

Starts a process from caller-controlled arguments; the security boundary depends on argument construction and shell mode.

Argument map · what each slot does

The pack does not provide a callable signature for this record; the watched access path is shown directly.

ArgAccess pathPurposeWatched
Argument[0]Argument[0]The access path Atropos marks for this model.▲ sink
The weakness
CWE-78
OS Command Injection

External input alters the syntax or behavior of an operating-system command.

What goes wrong
Attacker's-eye view · command-injection

An attacker adds separators, substitutions, or flags that turn a value into a second command or alter the first.

// modeled boundary: Argument[0] run(attacker_influenced_value);
To decide if this call is a bug, check
1Use a fixed executable and argument array.
2Keep shell parsing disabled where possible.
3Validate executable and argument domains.
These checks require the surrounding codebase. The model names the boundary; it does not decide reachability or prove that a guard dominates every path.
Is this a bug in your code?Atropos stops here — by design

Atropos identifies Argument[0] as a command-injection sink. It cannot see whether untrusted data reaches this call in your repository.

Lachesis is the codebase-level step: it traces reachability and guards for this symbol.

Check this symbol in Lachesis
Reviewed guidance

Safer direction: Pass a sequence of fixed executable and arguments, keep shell=False, and constrain executable selection.

Unsafe shape
subprocess.run(command, shell=True);
Safer shape
subprocess.run([binary, '--input', path], shell=False, check=True);
The family · command-injection
Model facts · verbatim from the pack
RoleKindAccess pathModel IDConfidence
sinkcommand-injectionArgument[0]python.subprocess.run.a0high · corrob. 3
sinkcommand-injectionArgument[1]python.subprocess.run.a1medium · corrob. 2
sinkcommand-injectionArgument[2]python.subprocess.run.a2medium · corrob. 2
Referencesdocs.python.org