File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed
python/ql/src/experimental/semmle/python/libraries Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ private module Authlib {
42
42
43
43
override DataFlow:: Node getAlgorithm ( ) {
44
44
exists ( KeyValuePair headerDict |
45
- headerDict = this .getArg ( 0 ) .asExpr ( ) .( Dict ) .getItems ( ) . getAnItem ( ) and
45
+ headerDict = this .getArg ( 0 ) .asExpr ( ) .( Dict ) .getItem ( _ ) and
46
46
headerDict .getKey ( ) .( Str_ ) .getS ( ) .matches ( "alg" ) and
47
47
result .asExpr ( ) = headerDict .getValue ( )
48
48
)
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ private module PyJWT {
101
101
predicate hasVerifySignatureSetToFalse ( ) {
102
102
exists ( KeyValuePair optionsDict , NameConstant falseName |
103
103
falseName .getId ( ) = "False" and
104
- optionsDict = this .getOptions ( ) .asExpr ( ) .( Dict ) .getItems ( ) . getAnItem ( ) and
104
+ optionsDict = this .getOptions ( ) .asExpr ( ) .( Dict ) .getItem ( _ ) and
105
105
optionsDict .getKey ( ) .( Str_ ) .getS ( ) .matches ( "%verify%" ) and
106
106
falseName = optionsDict .getValue ( )
107
107
)
Original file line number Diff line number Diff line change @@ -88,12 +88,18 @@ private module PythonJose {
88
88
89
89
override predicate verifiesSignature ( ) {
90
90
// jwt.decode(token, "key", "HS256")
91
- not exists ( this .getOptions ( ) )
91
+ this .hasNoOptions ( )
92
92
or
93
93
// jwt.decode(token, key, options={"verify_signature": False})
94
- not exists ( KeyValuePair optionsDict , NameConstant falseName |
94
+ not this .hasVerifySignatureSetToFalse ( )
95
+ }
96
+
97
+ predicate hasNoOptions ( ) { not exists ( this .getOptions ( ) ) }
98
+
99
+ predicate hasVerifySignatureSetToFalse ( ) {
100
+ exists ( KeyValuePair optionsDict , NameConstant falseName |
95
101
falseName .getId ( ) = "False" and
96
- optionsDict = this .getOptions ( ) .asExpr ( ) .( Dict ) .getItems ( ) . getAnItem ( ) and
102
+ optionsDict = this .getOptions ( ) .asExpr ( ) .( Dict ) .getItem ( _ ) and
97
103
optionsDict .getKey ( ) .( Str_ ) .getS ( ) .matches ( "%verify%" ) and
98
104
falseName = optionsDict .getValue ( )
99
105
)
You can’t perform that action at this time.
0 commit comments