-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a97b9b
commit 80af38e
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
java/ql/test/library-tests/frameworks/lastaflute/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import java.io.IOException; | ||
|
||
import org.lastaflute.web.Execute; | ||
import org.lastaflute.web.ruts.multipart.MultipartFormFile; | ||
|
||
public class Test { | ||
|
||
void sink(Object o) { | ||
} | ||
|
||
public class TestForm { | ||
public MultipartFormFile file; | ||
} | ||
|
||
@Execute | ||
public String index(TestForm form) throws IOException { | ||
MultipartFormFile file = form.file; | ||
|
||
sink(file.getFileData()); // $hasTaintFlow | ||
sink(file.getInputStream()); // $hasTaintFlow | ||
|
||
return "index.jsp"; | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/lastaflute |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import java | ||
import semmle.code.java.dataflow.DataFlow | ||
import semmle.code.java.dataflow.FlowSources | ||
import TestUtilities.InlineFlowTest | ||
|
||
module Config implements DataFlow::ConfigSig { | ||
predicate isSource(DataFlow::Node n) { n instanceof RemoteFlowSource } | ||
|
||
predicate isSink(DataFlow::Node n) { DefaultFlowConfig::isSink(n) } | ||
} | ||
|
||
import TaintFlowTest<Config> |
5 changes: 5 additions & 0 deletions
5
java/ql/test/stubs/lastaflute/org/lastaflute/web/Execute.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
java/ql/test/stubs/lastaflute/org/lastaflute/web/ruts/multipart/MultipartFormFile.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.