Skip to content

Commit c95f17f

Browse files
authored
Make java/path-injection recognise create-file MaD sinks
1 parent 0be625f commit c95f17f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ class TaintedPathConfig extends TaintTracking::Configuration {
3434
override predicate isSource(DataFlow::Node source) { source instanceof RemoteFlowSource }
3535

3636
override predicate isSink(DataFlow::Node sink) {
37-
exists(Expr e | e = sink.asExpr() | e = any(PathCreation p).getAnInput() and not guarded(e))
37+
(
38+
sink.asExpr() = any(PathCreation p).getAnInput()
39+
or
40+
sinkNode(sink, "create-file")
41+
) and
42+
not guarded(sink.asExpr())
3843
}
3944

4045
override predicate isSanitizer(DataFlow::Node node) {

0 commit comments

Comments
 (0)