eval

python · builtins
sink✓ Reviewed · 2026-09-04
RoleSink
WeaknessCWE-94 · CWE-95
WatchesArgument[0]
Kindcode-injection
Confidencehigh
Corroboration3

Evaluates a Python expression with ambient globals and locals, making input-to-code transitions difficult to constrain.

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-94
Code Injection

External input changes the syntax of generated code or executable instructions.

CWE-95
Eval Injection

Input is evaluated dynamically without neutralizing language directives.

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

An attacker supplies syntax that is evaluated with the process's privileges.

// modeled boundary: Argument[0] eval(attacker_influenced_value);
To decide if this call is a bug, check
1Keep code and data separate.
2Replace evaluation with a parser or allow-list.
3Constrain the execution context if evaluation remains.
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 code-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: Parse structured data or expose a small allow-listed operation set instead of evaluating source text.

Unsafe shape
eval(user_expression);
Safer shape
operator.add(left, right);
The family · code-injection
Model facts · verbatim from the pack
RoleKindAccess pathModel IDConfidence
sinkcode-injectionArgument[0]python.builtins.eval.a0high · corrob. 3
Referencesdocs.python.org