File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
go/ql/src/experimental/CWE-321-V2 Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -20,22 +20,16 @@ module JwtParseWithConstantKeyConfig implements DataFlow::ConfigSig {
20
20
// Find a node that has flow to a key Function argument
21
21
// then find the first result node of this Function which is the secret key
22
22
exists ( FuncDef fd , DataFlow:: Node n , DataFlow:: ResultNode rn |
23
+ fd = n .asExpr ( )
24
+ or
25
+ n = fd .( FuncDecl ) .getFunction ( ) .getARead ( )
26
+ |
23
27
GolangJwtKeyFunc:: flow ( n , _) and
24
28
sink = rn and
25
- fd = n .asExpr ( ) and
26
29
rn .getRoot ( ) = fd and
27
30
rn .getIndex ( ) = 0
28
31
)
29
32
or
30
- exists ( Function f , DataFlow:: ResultNode rn |
31
- GolangJwtKeyFunc:: flow ( f .getARead ( ) , _) and
32
- // sink is result of a method
33
- sink = rn and
34
- // the method is belong to a function in which is used as a JWT function key
35
- rn .getRoot ( ) = f .getFuncDecl ( ) and
36
- rn .getIndex ( ) = 0
37
- )
38
- or
39
33
// second part is the JWT Parsing Functions that get a string or byte as an argument
40
34
sink = any ( JwtParse jp ) .getKeyArg ( )
41
35
}
You can’t perform that action at this time.
0 commit comments