Refactor QL to make type check more concise

This commit is contained in:
Owen Mansel-Chan
2025-07-11 06:13:01 +01:00
parent 439cf7a659
commit 006d77ffdd

View File

@@ -149,10 +149,7 @@ predicate unsafeDeserialization(MethodCall ma, Expr sink) {
exists(Method m | m = ma.getMethod() |
m instanceof ObjectInputStreamReadObjectMethod and
sink = ma.getQualifier() and
not exists(DataFlow::ExprNode node |
node.getExpr() = sink and
node.getTypeBound() instanceof SafeObjectInputStreamType
)
not DataFlow::exprNode(sink).getTypeBound() instanceof SafeObjectInputStreamType
or
m instanceof XmlDecoderReadObjectMethod and
sink = ma.getQualifier()