Skip to content

Commit 075a83c

Browse files
committed
Stage stats before on 'ExecTainted.ql' before:
``` 1 10 1 Fwd 609968 1398 -1 94 769936 ExecTaintConfiguration 2 15 1 Rev 239464 774 -1 52 320663 ExecTaintConfiguration 3 20 2 Fwd 205794 511 650 39 18576546 ExecTaintConfiguration 4 25 2 Rev 161966 351 428 39 13639502 ExecTaintConfiguration 5 30 3 Fwd 31889 322 791 39 5982574 ExecTaintConfiguration 6 35 3 Rev 30068 303 661 39 4181421 ExecTaintConfiguration 7 40 4 Fwd 24031 232 1432 39 14725618 ExecTaintConfiguration 8 45 4 Rev 21506 219 907 39 5962780 ExecTaintConfiguration 9 50 5 Fwd 20149 204 1527 38 8350094 ExecTaintConfiguration 10 55 5 Rev 20102 204 1472 38 7515307 ExecTaintConfiguration 11 60 6 Fwd 19950 200 904 33 9673369 ExecTaintConfiguration 12 65 6 Rev 18431 200 901 33 7030957 ExecTaintConfiguration ``` Stage stats after: ``` 1 10 1 Fwd 368610 699 -1 65 445199 ExecTaintConfiguration 2 15 1 Rev 112848 336 -1 23 150522 ExecTaintConfiguration 3 20 2 Fwd 91528 219 270 22 4120713 ExecTaintConfiguration 4 25 2 Rev 66017 141 159 22 2657398 ExecTaintConfiguration 5 30 3 Fwd 12161 119 208 22 792468 ExecTaintConfiguration 6 35 3 Rev 11640 111 167 22 569193 ExecTaintConfiguration 7 40 4 Fwd 11423 109 331 22 1203871 ExecTaintConfiguration 8 45 4 Rev 10851 107 323 22 904017 ExecTaintConfiguration 9 50 5 Fwd 10694 107 763 22 2428404 ExecTaintConfiguration 10 55 5 Rev 10332 104 735 22 2355698 ExecTaintConfiguration 11 60 6 Fwd 10302 104 729 22 5772762 ExecTaintConfiguration 12 65 6 Rev 9482 102 725 22 4020951 ExecTaintConfiguration ```
1 parent 8dd0bdb commit 075a83c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ predicate isSinkImpl(DataFlow::Node sink, Expr command, string callChain) {
8585
shellCommand(command, callChain)
8686
}
8787

88+
predicate isSanitizerImpl(DataFlow::Node node) {
89+
node.asExpr().getUnspecifiedType() instanceof IntegralType
90+
or
91+
node.asExpr().getUnspecifiedType() instanceof FloatingPointType
92+
}
93+
8894
/**
8995
* A `TaintTracking` configuration that's used to find the relevant `ExecState`s for a
9096
* given sink. This avoids a cartesian product between all sinks and all `ExecState`s in
@@ -99,6 +105,8 @@ class ExecStateConfiguration extends TaintTracking2::Configuration {
99105

100106
override predicate isSink(DataFlow::Node sink) { isSinkImpl(sink, _, _) }
101107

108+
override predicate isSanitizer(DataFlow::Node node) { isSanitizerImpl(node) }
109+
102110
override predicate isSanitizerOut(DataFlow::Node node) {
103111
isSink(node, _) // Prevent duplicates along a call chain, since `shellCommand` will include wrappers
104112
}
@@ -126,14 +134,7 @@ class ExecTaintConfiguration extends TaintTracking::Configuration {
126134
state2.(ExecState).getOutgoingNode() = node2
127135
}
128136

129-
override predicate isSanitizer(DataFlow::Node node, DataFlow::FlowState state) {
130-
(
131-
node.asInstruction().getResultType() instanceof IntegralType
132-
or
133-
node.asInstruction().getResultType() instanceof FloatingPointType
134-
) and
135-
state instanceof ConcatState
136-
}
137+
override predicate isSanitizer(DataFlow::Node node) { isSanitizerImpl(node) }
137138

138139
override predicate isSanitizerOut(DataFlow::Node node) {
139140
isSink(node, _) // Prevent duplicates along a call chain, since `shellCommand` will include wrappers

0 commit comments

Comments
 (0)