Skip to content

Commit 995efef

Browse files
committed
C++: Add explanatory comment to hasFilteredFlowPath
1 parent 5637d57 commit 995efef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cpp/ql/src/Security/CWE/CWE-022/TaintedPath.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class TaintedPathConfiguration extends TaintTracking::Configuration {
111111

112112
predicate hasFilteredFlowPath(DataFlow::PathNode source, DataFlow::PathNode sink) {
113113
this.hasFlowPath(source, sink) and
114+
// The use of `isUserInput` in `isSink` in combination with `asSourceExpr` causes
115+
// duplicate results. Filter these duplicates. The proper solution is to switch to
116+
// using `LocalFlowSource` and `RemoteFlowSource`, but this currently only supports
117+
// a subset of the cases supported by `isUserInput`.
114118
not exists(DataFlow::PathNode source2 |
115119
this.hasFlowPath(source2, sink) and
116120
asSourceExpr(source.getNode()) = asSourceExpr(source2.getNode())

0 commit comments

Comments
 (0)