Skip to content

Commit c367c7e

Browse files
Merge branch 'unsafe-jackson-deserialization' of github.com:artem-smotrakov/ql into unsafe-jackson-deserialization
2 parents 3856527 + 1b3516a commit c367c7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/ql/src/semmle/code/java/frameworks/JacksonQuery.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ private class ObjectMapperReadQualifier extends DataFlow::ExprNode {
6464
/** A source that sets a type validator. */
6565
private class SetPolymorphicTypeValidatorSource extends DataFlow::ExprNode {
6666
SetPolymorphicTypeValidatorSource() {
67-
exists(MethodAccess ma, Method m, Expr q | m = ma.getMethod() and q = ma.getQualifier() |
67+
exists(MethodAccess ma, Method m | m = ma.getMethod() |
6868
(
6969
m.getDeclaringType() instanceof ObjectMapper and
7070
m.hasName("setPolymorphicTypeValidator")
7171
or
7272
m.getDeclaringType() instanceof MapperBuilder and
7373
m.hasName("polymorphicTypeValidator")
7474
) and
75-
this.asExpr() = q
75+
this.asExpr() = ma.getQualifier()
7676
)
7777
}
7878
}
@@ -120,7 +120,7 @@ class EnableJacksonDefaultTypingConfig extends DataFlow2::Configuration {
120120
}
121121

122122
/**
123-
* Tracks flow from calls, which set a type validator, to a subsequent Jackson deserialization method call,
123+
* Tracks flow from calls which set a type validator to a subsequent Jackson deserialization method call,
124124
* including across builder method calls.
125125
*
126126
* Such a Jackson deserialization method call is safe because validation will likely prevent instantiating unexpected types.

0 commit comments

Comments
 (0)