Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add models for the lastaflute framework #16993

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests for lastaflute framework
  • Loading branch information
egregius313 committed Jul 18, 2024
commit 62944ee473641cec521bdbec0c1286cb422a3faa
27 changes: 27 additions & 0 deletions java/ql/test/library-tests/frameworks/lastaflute/Test.java
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";
}

}


1 change: 1 addition & 0 deletions java/ql/test/library-tests/frameworks/lastaflute/options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/lastaflute
Empty file.
11 changes: 11 additions & 0 deletions java/ql/test/library-tests/frameworks/lastaflute/test.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import java
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>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.