Skip to content

Commit b6952d5

Browse files
author
edvraa
committed
get rid of getParent
1 parent 9cc67e4 commit b6952d5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

csharp/ql/src/Security Features/CWE-502/UnsafeDeserializationUntrustedInput.ql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,20 @@ where
2424
(
2525
exists(
2626
DataFlow::Node weakTypeCreation, DataFlow::Node weakTypeUsage,
27-
WeakTypeCreationToUsageTrackingConfig weakTypeDeserializerTracking
27+
WeakTypeCreationToUsageTrackingConfig weakTypeDeserializerTracking, MethodCall mc
2828
|
2929
weakTypeDeserializerTracking.hasFlow(weakTypeCreation, weakTypeUsage) and
30-
weakTypeUsage.asExpr().getParent() = deserializeCallArg.getNode().asExpr().getParent()
30+
mc.getQualifier() = weakTypeUsage.asExpr() and
31+
mc.getAnArgument() = deserializeCallArg.getNode().asExpr()
3132
)
3233
or
3334
exists(
3435
TaintToObjectTypeTrackingConfig userControlledTypeTracking, DataFlow::Node taintedTypeUsage,
35-
DataFlow::Node userInput2
36+
DataFlow::Node userInput2, MethodCall mc
3637
|
3738
userControlledTypeTracking.hasFlow(userInput2, taintedTypeUsage) and
38-
taintedTypeUsage.asExpr().getParent() = deserializeCallArg.getNode().asExpr().getParent()
39+
mc.getQualifier() = taintedTypeUsage.asExpr() and
40+
mc.getAnArgument() = deserializeCallArg.getNode().asExpr()
3941
)
4042
) and
4143
// exclude deserialization flows with safe instances (i.e. JavaScriptSerializer without resolver)

0 commit comments

Comments
 (0)