File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
python/ql/src/experimental/Security/CWE-287-ConstantSecretKey Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,12 @@ class WebAppConstantSecretKeySource extends DataFlow::Node {
11
11
env = API:: moduleImport ( "environ" ) .getMember ( "Env" ) and
12
12
// has default value
13
13
exists ( API:: Node param | param = env .getKeywordParameter ( "SECRET_KEY" ) |
14
- param .asSink ( ) .asExpr ( ) .getASubExpression * ( ) . isConstant ( )
14
+ param .asSink ( ) .asExpr ( ) .getASubExpression * ( ) instanceof StrConst
15
15
) and
16
16
this = env .getReturn ( ) .getReturn ( ) .asSource ( )
17
17
)
18
18
or
19
- this .asExpr ( ) . isConstant ( )
19
+ this .asExpr ( ) instanceof StrConst
20
20
or
21
21
exists ( API:: CallNode cn |
22
22
cn =
@@ -25,7 +25,7 @@ class WebAppConstantSecretKeySource extends DataFlow::Node {
25
25
API:: moduleImport ( "os" ) .getMember ( "environ" ) .getMember ( "get" ) .getACall ( )
26
26
] and
27
27
cn .getNumArgument ( ) = 2 and
28
- DataFlow:: localFlow ( any ( DataFlow:: Node n | n .asExpr ( ) . isConstant ( ) ) , cn .getArg ( 1 ) ) and
28
+ DataFlow:: localFlow ( any ( DataFlow:: Node n | n .asExpr ( ) instanceof StrConst ) , cn .getArg ( 1 ) ) and
29
29
this .asExpr ( ) = cn .asExpr ( )
30
30
)
31
31
) and
You can’t perform that action at this time.
0 commit comments