@@ -17,6 +17,11 @@ class TypeJwtParser extends Interface {
17
17
TypeJwtParser ( ) { this .hasQualifiedName ( "io.jsonwebtoken" , "JwtParser" ) }
18
18
}
19
19
20
+ /** The interface `io.jsonwebtoken.JwtParser` or a type derived from it. */
21
+ class TypeDerivedJwtParser extends RefType {
22
+ TypeDerivedJwtParser ( ) { this .getASourceSupertype * ( ) instanceof TypeJwtParser }
23
+ }
24
+
20
25
/** The interface `io.jsonwebtoken.JwtParserBuilder`. */
21
26
class TypeJwtParserBuilder extends Interface {
22
27
TypeJwtParserBuilder ( ) { this .hasQualifiedName ( "io.jsonwebtoken" , "JwtParserBuilder" ) }
@@ -122,7 +127,7 @@ private class JwtParserWithSigningKeyExpr extends Expr {
122
127
MethodAccess signingMa ;
123
128
124
129
JwtParserWithSigningKeyExpr ( ) {
125
- this .getType ( ) . ( RefType ) . getASourceSupertype * ( ) instanceof TypeJwtParser and
130
+ this .getType ( ) instanceof TypeDerivedJwtParser and
126
131
isSigningKeySetter ( this , signingMa )
127
132
}
128
133
@@ -142,13 +147,13 @@ private class SigningToExprDataFlow extends DataFlow::Configuration {
142
147
}
143
148
144
149
override predicate isSink ( DataFlow:: Node sink ) {
145
- sink .asExpr ( ) .getType ( ) . ( RefType ) . getASourceSupertype * ( ) instanceof TypeJwtParser
150
+ sink .asExpr ( ) .getType ( ) instanceof TypeDerivedJwtParser
146
151
}
147
152
148
153
/** Models the builder style of `JwtParser` and `JwtParserBuilder`. */
149
154
override predicate isAdditionalFlowStep ( DataFlow:: Node pred , DataFlow:: Node succ ) {
150
155
(
151
- pred .asExpr ( ) .getType ( ) . ( RefType ) . getASourceSupertype * ( ) instanceof TypeJwtParser or
156
+ pred .asExpr ( ) .getType ( ) instanceof TypeDerivedJwtParser or
152
157
pred .asExpr ( ) .getType ( ) .( RefType ) .getASourceSupertype * ( ) instanceof TypeJwtParserBuilder
153
158
) and
154
159
succ .asExpr ( ) .( MethodAccess ) .getQualifier ( ) = pred .asExpr ( )
0 commit comments