File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
python/ql/src/Security/CWE-215 Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -16,21 +16,10 @@ import semmle.python.dataflow.new.DataFlow
16
16
import semmle.python.ApiGraphs
17
17
import semmle.python.frameworks.Flask
18
18
19
- /** Gets a reference to a truthy literal. */
20
- private DataFlow:: TypeTrackingNode truthyLiteral ( DataFlow:: TypeTracker t ) {
21
- t .start ( ) and
22
- result .asExpr ( ) .( ImmutableLiteral ) .booleanValue ( ) = true
23
- or
24
- exists ( DataFlow:: TypeTracker t2 | result = truthyLiteral ( t2 ) .track ( t2 , t ) )
25
- }
26
-
27
- /** Gets a reference to a truthy literal. */
28
- DataFlow:: Node truthyLiteral ( ) { truthyLiteral ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
29
-
30
- from API:: CallNode call , DataFlow:: Node debugArg
19
+ from API:: CallNode call
31
20
where
32
21
call = Flask:: FlaskApp:: instance ( ) .getMember ( "run" ) .getACall ( ) and
33
- debugArg in [ call .getArg ( 2 ) , call . getArgByName ( "debug" ) ] and
34
- debugArg = truthyLiteral ( )
22
+ call .getParameter ( 2 , "debug" ) . getAValueReachingSink ( ) . asExpr ( ) . ( ImmutableLiteral ) . booleanValue ( ) =
23
+ true
35
24
select call ,
36
25
"A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger."
You can’t perform that action at this time.
0 commit comments