File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
python/ql/src/semmle/python/security/injection Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,6 @@ import python
1010import semmle.python.security.TaintTracking
1111import semmle.python.security.strings.Untrusted
1212
13- private FunctionObject exec_or_eval ( ) {
14- result = Object:: builtin ( "exec" )
15- or
16- result = Object:: builtin ( "eval" )
17- }
18-
1913/**
2014 * A taint sink that represents an argument to exec or eval that is vulnerable to malicious input.
2115 * The `vuln` in `exec(vuln)` or similar.
@@ -26,10 +20,9 @@ class StringEvaluationNode extends TaintSink {
2620 StringEvaluationNode ( ) {
2721 exists ( Exec exec | exec .getASubExpression ( ) .getAFlowNode ( ) = this )
2822 or
29- exists ( CallNode call |
30- exec_or_eval ( ) .getACall ( ) = call and
31- call .getAnArg ( ) = this
32- )
23+ Value:: named ( "exec" ) .getACall ( ) .getAnArg ( ) = this
24+ or
25+ Value:: named ( "eval" ) .getACall ( ) .getAnArg ( ) = this
3326 }
3427
3528 override predicate sinks ( TaintKind kind ) { kind instanceof ExternalStringKind }
You can’t perform that action at this time.
0 commit comments