Skip to content

Commit f8867e4

Browse files
author
edvraa
committed
Rename deserializeCall to deserializeCallArg
1 parent aa9d848 commit f8867e4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ class LocalSource extends Source {
2626

2727
from
2828
TaintToObjectMethodTrackingConfig taintTracking, DataFlow::PathNode userInput,
29-
DataFlow::PathNode deserializeCall
29+
DataFlow::PathNode deserializeCallArg
3030
where
3131
// all flows from user input to deserialization with weak and strong type serializers
32-
taintTracking.hasFlowPath(userInput, deserializeCall) and
32+
taintTracking.hasFlowPath(userInput, deserializeCallArg) and
3333
// intersect with strong types, but user controlled or weak types deserialization usages
3434
(
3535
exists(
3636
DataFlow::PathNode weakTypeCreation, DataFlow::PathNode weakTypeUsage,
3737
WeakTypeCreationToUsageTrackingConfig weakTypeDeserializerTracking
3838
|
3939
weakTypeDeserializerTracking.hasFlowPath(weakTypeCreation, weakTypeUsage) and
40-
weakTypeUsage.getNode().asExpr().getParent() = deserializeCall.getNode().asExpr().getParent()
40+
weakTypeUsage.getNode().asExpr().getParent() =
41+
deserializeCallArg.getNode().asExpr().getParent()
4142
)
4243
or
4344
exists(
@@ -46,7 +47,7 @@ where
4647
|
4748
userControlledTypeTracking.hasFlowPath(userInput2, taintedTypeUsage) and
4849
taintedTypeUsage.getNode().asExpr().getParent() =
49-
deserializeCall.getNode().asExpr().getParent()
50+
deserializeCallArg.getNode().asExpr().getParent()
5051
)
5152
) and
5253
// exclude deserialization flows with safe instances (i.e. JavaScriptSerializer without resolver)
@@ -55,12 +56,12 @@ where
5556
DataFlow::PathNode safeTypeUsage
5657
|
5758
safeConstructorTracking.hasFlowPath(safeCreation, safeTypeUsage) and
58-
safeTypeUsage.getNode().asExpr().getParent() = deserializeCall.getNode().asExpr().getParent()
59+
safeTypeUsage.getNode().asExpr().getParent() = deserializeCallArg.getNode().asExpr().getParent()
5960
)
6061
or
6162
// no type check needed - straightforward taint -> sink
6263
exists(TaintToConstructorOrStaticMethodTrackingConfig taintTracking2 |
63-
taintTracking2.hasFlowPath(userInput, deserializeCall)
64+
taintTracking2.hasFlowPath(userInput, deserializeCallArg)
6465
)
65-
select deserializeCall, userInput, deserializeCall, "$@ flows to unsafe deserializer.", userInput,
66-
"User-provided data"
66+
select deserializeCallArg, userInput, deserializeCallArg, "$@ flows to unsafe deserializer.",
67+
userInput, "User-provided data"

0 commit comments

Comments
 (0)