Skip to content

Commit 611b509

Browse files
committed
Add existing models of file reads to local threat model sources
1 parent 2cd1d2f commit 611b509

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/FlowSources.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import semmle.code.java.frameworks.Guice
3030
import semmle.code.java.frameworks.struts.StrutsActions
3131
import semmle.code.java.frameworks.Thrift
3232
import semmle.code.java.frameworks.javaee.jsf.JSFRenderer
33+
import semmle.code.java.security.FileReadWrite
3334
private import semmle.code.java.dataflow.ExternalFlow
3435
private import codeql.threatmodels.ThreatModels
3536

@@ -248,7 +249,7 @@ private class StdinInput extends LocalUserInput {
248249
private class FileInput extends LocalUserInput {
249250
FileInput() {
250251
// Access to files.
251-
sourceNode(this, "file")
252+
sourceNode(this, "file") or this.asExpr() instanceof FileReadExpr
252253
}
253254

254255
override string getThreatModel() { result = "file" }

0 commit comments

Comments
 (0)