mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #13346 from jketema/inline-2
Update inline expectation tests to use parameterized module
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,14 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.CleverGo
|
||||
|
||||
class HttpHeaderWriteTest extends InlineExpectationsTest {
|
||||
HttpHeaderWriteTest() { this = "HttpHeaderWriteTest" }
|
||||
module HttpHeaderWriteTest implements TestSig {
|
||||
string getARelevantTag() { result = ["headerKeyNode", "headerValNode", "headerKey", "headerVal"] }
|
||||
|
||||
override string getARelevantTag() {
|
||||
result = ["headerKeyNode", "headerValNode", "headerKey", "headerVal"]
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
// Dynamic key-value header:
|
||||
exists(Http::HeaderWrite hw |
|
||||
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -56,3 +52,5 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpHeaderWriteTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.CleverGo
|
||||
|
||||
class HttpRedirectTest extends InlineExpectationsTest {
|
||||
HttpRedirectTest() { this = "HttpRedirectTest" }
|
||||
module HttpRedirectTest implements TestSig {
|
||||
string getARelevantTag() { result = "redirectUrl" }
|
||||
|
||||
override string getARelevantTag() { result = "redirectUrl" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "redirectUrl" and
|
||||
exists(Http::Redirect rd |
|
||||
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -17,3 +15,5 @@ class HttpRedirectTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpRedirectTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.CleverGo
|
||||
|
||||
class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
HttpResponseBodyTest() { this = "HttpResponseBodyTest" }
|
||||
module HttpResponseBodyTest implements TestSig {
|
||||
string getARelevantTag() { result = ["contentType", "responseBody"] }
|
||||
|
||||
override string getARelevantTag() { result = ["contentType", "responseBody"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(Http::ResponseBody rd |
|
||||
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||
@@ -23,3 +21,5 @@ class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpResponseBodyTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -14,12 +14,10 @@ class Configuration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintTrackingTest extends InlineExpectationsTest {
|
||||
TaintTrackingTest() { this = "TaintTrackingTest" }
|
||||
module TaintTrackingTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintSink" }
|
||||
|
||||
override string getARelevantTag() { result = "taintSink" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintSink" and
|
||||
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -29,3 +27,5 @@ class TaintTrackingTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<TaintTrackingTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.CleverGo
|
||||
|
||||
class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
UntrustedFlowSourceTest() { this = "UntrustedFlowSourceTest" }
|
||||
module UntrustedFlowSourceTest implements TestSig {
|
||||
string getARelevantTag() { result = "untrustedFlowSource" }
|
||||
|
||||
override string getARelevantTag() { result = "untrustedFlowSource" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "untrustedFlowSource" and
|
||||
exists(DataFlow::CallNode sinkCall, DataFlow::ArgumentNode arg |
|
||||
sinkCall.getCalleeName() = "sink" and
|
||||
@@ -21,3 +19,5 @@ class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<UntrustedFlowSourceTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,14 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.Fiber
|
||||
|
||||
class HttpHeaderWriteTest extends InlineExpectationsTest {
|
||||
HttpHeaderWriteTest() { this = "HttpHeaderWriteTest" }
|
||||
module HttpHeaderWriteTest implements TestSig {
|
||||
string getARelevantTag() { result = ["headerKeyNode", "headerValNode", "headerKey", "headerVal"] }
|
||||
|
||||
override string getARelevantTag() {
|
||||
result = ["headerKeyNode", "headerValNode", "headerKey", "headerVal"]
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
// Dynamic key-value header:
|
||||
exists(Http::HeaderWrite hw |
|
||||
hw.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -56,3 +52,5 @@ class HttpHeaderWriteTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpHeaderWriteTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.Fiber
|
||||
|
||||
class HttpRedirectTest extends InlineExpectationsTest {
|
||||
HttpRedirectTest() { this = "HttpRedirectTest" }
|
||||
module HttpRedirectTest implements TestSig {
|
||||
string getARelevantTag() { result = "redirectUrl" }
|
||||
|
||||
override string getARelevantTag() { result = "redirectUrl" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "redirectUrl" and
|
||||
exists(Http::Redirect rd |
|
||||
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -17,3 +15,5 @@ class HttpRedirectTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpRedirectTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.Fiber
|
||||
|
||||
class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
HttpResponseBodyTest() { this = "HttpResponseBodyTest" }
|
||||
module HttpResponseBodyTest implements TestSig {
|
||||
string getARelevantTag() { result = ["contentType", "responseBody"] }
|
||||
|
||||
override string getARelevantTag() { result = ["contentType", "responseBody"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(Http::ResponseBody rd |
|
||||
rd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||
@@ -23,3 +21,5 @@ class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpResponseBodyTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -14,12 +14,10 @@ class Configuration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintTrackingTest extends InlineExpectationsTest {
|
||||
TaintTrackingTest() { this = "TaintTrackingTest" }
|
||||
module TaintTrackingTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintSink" }
|
||||
|
||||
override string getARelevantTag() { result = "taintSink" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintSink" and
|
||||
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -29,3 +27,5 @@ class TaintTrackingTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<TaintTrackingTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import experimental.frameworks.Fiber
|
||||
|
||||
class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
UntrustedFlowSourceTest() { this = "UntrustedFlowSourceTest" }
|
||||
module UntrustedFlowSourceTest implements TestSig {
|
||||
string getARelevantTag() { result = "untrustedFlowSource" }
|
||||
|
||||
override string getARelevantTag() { result = "untrustedFlowSource" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "untrustedFlowSource" and
|
||||
exists(DataFlow::CallNode sinkCall, DataFlow::ArgumentNode arg |
|
||||
sinkCall.getCalleeName() = "sink" and
|
||||
@@ -21,3 +19,5 @@ class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<UntrustedFlowSourceTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class FunctionIsVariadicTest extends InlineExpectationsTest {
|
||||
FunctionIsVariadicTest() { this = "Function::IsVariadicTest" }
|
||||
module FunctionIsVariadicTest implements TestSig {
|
||||
string getARelevantTag() { result = "isVariadic" }
|
||||
|
||||
override string getARelevantTag() { result = "isVariadic" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(CallExpr ce |
|
||||
ce.getTarget().isVariadic() and
|
||||
ce.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -17,3 +15,5 @@ class FunctionIsVariadicTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<FunctionIsVariadicTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class ImplementsComparableTest extends InlineExpectationsTest {
|
||||
ImplementsComparableTest() { this = "ImplementsComparableTest" }
|
||||
module ImplementsComparableTest implements TestSig {
|
||||
string getARelevantTag() { result = "implementsComparable" }
|
||||
|
||||
override string getARelevantTag() { result = "implementsComparable" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
// file = "interface.go" and
|
||||
tag = "implementsComparable" and
|
||||
exists(TypeSpec ts |
|
||||
@@ -20,3 +18,5 @@ class ImplementsComparableTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<ImplementsComparableTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class SignatureTypeIsVariadicTest extends InlineExpectationsTest {
|
||||
SignatureTypeIsVariadicTest() { this = "SignatureType::IsVariadicTest" }
|
||||
module SignatureTypeIsVariadicTest implements TestSig {
|
||||
string getARelevantTag() { result = "isVariadic" }
|
||||
|
||||
override string getARelevantTag() { result = "isVariadic" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(FuncDef fd |
|
||||
fd.isVariadic() and
|
||||
fd.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -17,3 +15,5 @@ class SignatureTypeIsVariadicTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<SignatureTypeIsVariadicTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class HttpHandler extends InlineExpectationsTest {
|
||||
HttpHandler() { this = "httphandler" }
|
||||
module HttpHandler implements TestSig {
|
||||
string getARelevantTag() { result = "handler" }
|
||||
|
||||
override string getARelevantTag() { result = "handler" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "handler" and
|
||||
exists(Http::RequestHandler h, DataFlow::Node check |
|
||||
element = h.toString() and value = check.toString()
|
||||
@@ -17,3 +15,5 @@ class HttpHandler extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HttpHandler>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class LoggerTest extends InlineExpectationsTest {
|
||||
LoggerTest() { this = "LoggerTest" }
|
||||
module LoggerTest implements TestSig {
|
||||
string getARelevantTag() { result = "logger" }
|
||||
|
||||
override string getARelevantTag() { result = "logger" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(LoggerCall log |
|
||||
log.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||
@@ -16,3 +14,5 @@ class LoggerTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<LoggerTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -13,12 +13,10 @@ class DataConfiguration extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(DataConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -41,12 +39,10 @@ class TaintConfiguration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintFlowTest extends InlineExpectationsTest {
|
||||
TaintFlowTest() { this = "TaintFlowTest" }
|
||||
module TaintFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintflow" and
|
||||
exists(DataFlow::Node sink | any(TaintConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -56,3 +52,5 @@ class TaintFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<DataFlowTest, TaintFlowTest>>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
failures
|
||||
invalidModelRow
|
||||
testFailures
|
||||
|
||||
@@ -15,12 +15,10 @@ class DataConfiguration extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(DataConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -43,12 +41,10 @@ class TaintConfiguration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintFlowTest extends InlineExpectationsTest {
|
||||
TaintFlowTest() { this = "TaintFlowTest" }
|
||||
module TaintFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintflow" and
|
||||
exists(DataFlow::Node sink | any(TaintConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -58,3 +54,5 @@ class TaintFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<DataFlowTest, TaintFlowTest>>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -23,12 +23,10 @@ class TestConfig extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(TestConfig c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -38,3 +36,5 @@ class DataFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<DataFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -13,12 +13,10 @@ class TestConfig extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(TestConfig c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -28,3 +26,5 @@ class DataFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<DataFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -21,12 +21,10 @@ class TestConfig extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class PromotedFieldsTest extends InlineExpectationsTest {
|
||||
PromotedFieldsTest() { this = "PromotedFieldsTest" }
|
||||
module PromotedFieldsTest implements TestSig {
|
||||
string getARelevantTag() { result = "promotedfields" }
|
||||
|
||||
override string getARelevantTag() { result = "promotedfields" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(TestConfig config, DataFlow::PathNode sink |
|
||||
config.hasFlowPath(_, sink) and
|
||||
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -37,3 +35,5 @@ class PromotedFieldsTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<PromotedFieldsTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -21,12 +21,10 @@ class TestConfig extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class PromotedMethodsTest extends InlineExpectationsTest {
|
||||
PromotedMethodsTest() { this = "PromotedMethodsTest" }
|
||||
module PromotedMethodsTest implements TestSig {
|
||||
string getARelevantTag() { result = "promotedmethods" }
|
||||
|
||||
override string getARelevantTag() { result = "promotedmethods" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(TestConfig config, DataFlow::Node source, DataFlow::Node sink |
|
||||
config.hasFlow(source, sink)
|
||||
|
|
||||
@@ -38,3 +36,5 @@ class PromotedMethodsTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<PromotedMethodsTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -13,12 +13,10 @@ class Configuration extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -28,3 +26,5 @@ class DataFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<DataFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -13,12 +13,10 @@ class DataConfiguration extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(DataConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -41,12 +39,10 @@ class TaintConfiguration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintFlowTest extends InlineExpectationsTest {
|
||||
TaintFlowTest() { this = "TaintFlowTest" }
|
||||
module TaintFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintflow" and
|
||||
exists(DataFlow::Node sink | any(TaintConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -56,3 +52,5 @@ class TaintFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<DataFlowTest, TaintFlowTest>>
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
failures
|
||||
invalidModelRow
|
||||
testFailures
|
||||
|
||||
@@ -43,12 +43,10 @@ class DataConfiguration extends DataFlow::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class DataFlowTest extends InlineExpectationsTest {
|
||||
DataFlowTest() { this = "DataFlowTest" }
|
||||
module DataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override string getARelevantTag() { result = "dataflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "dataflow" and
|
||||
exists(DataFlow::Node sink | any(DataConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -71,12 +69,10 @@ class TaintConfiguration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintFlowTest extends InlineExpectationsTest {
|
||||
TaintFlowTest() { this = "TaintFlowTest" }
|
||||
module TaintFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintflow" and
|
||||
exists(DataFlow::Node sink | any(TaintConfiguration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -86,6 +82,8 @@ class TaintFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<DataFlowTest, TaintFlowTest>>
|
||||
// from TaintConfiguration cfg, DataFlow::PartialPathNode source, DataFlow::PartialPathNode sink
|
||||
// where
|
||||
// cfg.hasPartialFlow(source, sink, _)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import semmle.go.security.SqlInjection
|
||||
|
||||
class SqlInjectionTest extends InlineExpectationsTest {
|
||||
SqlInjectionTest() { this = "SqlInjectionTest" }
|
||||
module SqlInjectionTest implements TestSig {
|
||||
string getARelevantTag() { result = "sqlinjection" }
|
||||
|
||||
override string getARelevantTag() { result = "sqlinjection" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "sqlinjection" and
|
||||
exists(DataFlow::Node sink | any(SqlInjection::Configuration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -17,3 +15,5 @@ class SqlInjectionTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<SqlInjectionTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -16,12 +16,10 @@ class Configuration extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class TaintFlowTest extends InlineExpectationsTest {
|
||||
TaintFlowTest() { this = "TaintFlowTest" }
|
||||
module TaintFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override string getARelevantTag() { result = "taintflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "taintflow" and
|
||||
exists(DataFlow::Node sink | any(Configuration c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -31,3 +29,5 @@ class TaintFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<TaintFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import semmle.go.frameworks.GoKit
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
UntrustedFlowSourceTest() { this = "untrustedflowsourcetest" }
|
||||
module UntrustedFlowSourceTest implements TestSig {
|
||||
string getARelevantTag() { result = "source" }
|
||||
|
||||
override string getARelevantTag() { result = "source" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(UntrustedFlowSource source |
|
||||
source
|
||||
.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -18,3 +16,5 @@ class UntrustedFlowSourceTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<UntrustedFlowSourceTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -21,12 +21,10 @@ class TestConfig extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class K8sIoApiCoreV1Test extends InlineExpectationsTest {
|
||||
K8sIoApiCoreV1Test() { this = "K8sIoApiCoreV1Test" }
|
||||
module K8sIoApiCoreV1Test implements TestSig {
|
||||
string getARelevantTag() { result = "KsIoApiCoreV" }
|
||||
|
||||
override string getARelevantTag() { result = "KsIoApiCoreV" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(TestConfig config, DataFlow::PathNode sink |
|
||||
config.hasFlowPath(_, sink) and
|
||||
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -37,3 +35,5 @@ class K8sIoApiCoreV1Test extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<K8sIoApiCoreV1Test>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -21,12 +21,10 @@ class TestConfig extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class K8sIoApimachineryPkgRuntimeTest extends InlineExpectationsTest {
|
||||
K8sIoApimachineryPkgRuntimeTest() { this = "KsIoApimachineryPkgRuntimeTest" }
|
||||
module K8sIoApimachineryPkgRuntimeTest implements TestSig {
|
||||
string getARelevantTag() { result = "KsIoApimachineryPkgRuntime" }
|
||||
|
||||
override string getARelevantTag() { result = "KsIoApimachineryPkgRuntime" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(TestConfig config, DataFlow::PathNode sink |
|
||||
config.hasFlowPath(_, sink) and
|
||||
sink.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -37,3 +35,5 @@ class K8sIoApimachineryPkgRuntimeTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<K8sIoApimachineryPkgRuntimeTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class K8sIoApimachineryPkgRuntimeTest extends InlineExpectationsTest {
|
||||
K8sIoApimachineryPkgRuntimeTest() { this = "KsIoClientGoTest" }
|
||||
module K8sIoApimachineryPkgRuntimeTest implements TestSig {
|
||||
string getARelevantTag() { result = "KsIoClientGo" }
|
||||
|
||||
override string getARelevantTag() { result = "KsIoClientGo" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(K8sIoClientGo::SecretInterfaceSource source |
|
||||
source
|
||||
.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -17,3 +15,5 @@ class K8sIoApimachineryPkgRuntimeTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<K8sIoApimachineryPkgRuntimeTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class NoSqlQueryTest extends InlineExpectationsTest {
|
||||
NoSqlQueryTest() { this = "NoSQLQueryTest" }
|
||||
module NoSqlQueryTest implements TestSig {
|
||||
string getARelevantTag() { result = "nosqlquery" }
|
||||
|
||||
override string getARelevantTag() { result = "nosqlquery" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(NoSql::Query q |
|
||||
q.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||
@@ -16,3 +14,5 @@ class NoSqlQueryTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<NoSqlQueryTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -15,12 +15,10 @@ class TestConfig extends TaintTracking::Configuration {
|
||||
override predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
|
||||
}
|
||||
|
||||
class MissingDataFlowTest extends InlineExpectationsTest {
|
||||
MissingDataFlowTest() { this = "MissingDataFlow" }
|
||||
module MissingDataFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "noflow" }
|
||||
|
||||
override string getARelevantTag() { result = "noflow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "noflow" and
|
||||
value = "" and
|
||||
exists(Sink sink |
|
||||
@@ -32,12 +30,10 @@ class MissingDataFlowTest extends InlineExpectationsTest {
|
||||
}
|
||||
}
|
||||
|
||||
class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
HttpResponseBodyTest() { this = "HttpResponseBodyTest" }
|
||||
module HttpResponseBodyTest implements TestSig {
|
||||
string getARelevantTag() { result = "responsebody" }
|
||||
|
||||
override string getARelevantTag() { result = "responsebody" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "responsebody" and
|
||||
exists(Http::ResponseBody rb |
|
||||
rb.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
@@ -47,3 +43,5 @@ class HttpResponseBodyTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<MissingDataFlowTest, HttpResponseBodyTest>>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class FileSystemAccessTest extends InlineExpectationsTest {
|
||||
FileSystemAccessTest() { this = "FileSystemAccess" }
|
||||
module FileSystemAccessTest implements TestSig {
|
||||
string getARelevantTag() { result = "fsaccess" }
|
||||
|
||||
override string getARelevantTag() { result = "fsaccess" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
exists(FileSystemAccess f |
|
||||
f.hasLocationInfo(location.getFile().getAbsolutePath(), location.getStartLine(),
|
||||
location.getStartColumn(), location.getEndLine(), location.getEndColumn()) and
|
||||
@@ -16,3 +14,5 @@ class FileSystemAccessTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<FileSystemAccessTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -13,12 +13,10 @@ class TestConfig extends TaintTracking::Configuration {
|
||||
}
|
||||
}
|
||||
|
||||
class ZapTest extends InlineExpectationsTest {
|
||||
ZapTest() { this = "ZapTest" }
|
||||
module ZapTest implements TestSig {
|
||||
string getARelevantTag() { result = "zap" }
|
||||
|
||||
override string getARelevantTag() { result = "zap" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "zap" and
|
||||
exists(DataFlow::Node sink | any(TestConfig c).hasFlow(_, sink) |
|
||||
element = sink.toString() and
|
||||
@@ -28,3 +26,5 @@ class ZapTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<ZapTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import go
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
import semmle.go.security.IncorrectIntegerConversionLib
|
||||
|
||||
class TestIncorrectIntegerConversion extends InlineExpectationsTest {
|
||||
TestIncorrectIntegerConversion() { this = "TestIncorrectIntegerConversion" }
|
||||
module TestIncorrectIntegerConversion implements TestSig {
|
||||
string getARelevantTag() { result = "hasValueFlow" }
|
||||
|
||||
override string getARelevantTag() { result = "hasValueFlow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasValueFlow" and
|
||||
exists(DataFlow::Node sink, DataFlow::Node sinkConverted |
|
||||
any(ConversionWithoutBoundsCheckConfig config).hasFlowTo(sink) and
|
||||
@@ -21,3 +19,5 @@ class TestIncorrectIntegerConversion extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<TestIncorrectIntegerConversion>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -19,12 +19,10 @@ module Config implements DataFlow::ConfigSig {
|
||||
|
||||
module Flow = TaintTracking::Global<Config>;
|
||||
|
||||
class InlineFlowTest extends InlineExpectationsTest {
|
||||
InlineFlowTest() { this = "HasFlowTest" }
|
||||
module InlineFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "flow" }
|
||||
|
||||
override string getARelevantTag() { result = "flow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "flow" and
|
||||
exists(DataFlow::Node sink | Flow::flowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -33,3 +31,5 @@ class InlineFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<InlineFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -12,12 +12,10 @@ module Config implements DataFlow::ConfigSig {
|
||||
|
||||
module Flow = DataFlow::Global<Config>;
|
||||
|
||||
class HasFlowTest extends InlineExpectationsTest {
|
||||
HasFlowTest() { this = "HasFlowTest" }
|
||||
module HasFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "flow" }
|
||||
|
||||
override string getARelevantTag() { result = "flow" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "flow" and
|
||||
exists(DataFlow::Node src, DataFlow::Node sink | Flow::flow(src, sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -26,3 +24,5 @@ class HasFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HasFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -18,12 +18,10 @@ module TaintFlowConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module TaintFlow = TaintTracking::Global<TaintFlowConfig>;
|
||||
|
||||
class HasFlowTest extends InlineExpectationsTest {
|
||||
HasFlowTest() { this = "HasFlowTest" }
|
||||
module HasFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "hasTaintFlow" }
|
||||
|
||||
override string getARelevantTag() { result = ["hasTaintFlow"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasTaintFlow" and
|
||||
exists(DataFlow::Node sink | TaintFlow::flowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -32,3 +30,5 @@ class HasFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HasFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -59,12 +59,10 @@ module Flow = TaintTracking::GlobalWithState<Config>;
|
||||
|
||||
module PartialFlow = Flow::FlowExploration<explorationLimit/0>;
|
||||
|
||||
class HasFlowTest extends InlineExpectationsTest {
|
||||
HasFlowTest() { this = "HasFlowTest" }
|
||||
module HasFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = ["pFwd", "pRev", "flow"] }
|
||||
|
||||
override string getARelevantTag() { result = ["pFwd", "pRev", "flow"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "flow" and
|
||||
exists(Flow::PathNode src, Flow::PathNode sink |
|
||||
Flow::flowPath(src, sink) and
|
||||
@@ -92,3 +90,5 @@ class HasFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HasFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -26,12 +26,10 @@ module LocalTaintConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module LocalTaintFlow = TaintTracking::Global<LocalTaintConfig>;
|
||||
|
||||
class LocalFlowTest extends InlineExpectationsTest {
|
||||
LocalFlowTest() { this = "LocalFlowTest" }
|
||||
module LocalFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = ["hasLocalValueFlow", "hasLocalTaintFlow"] }
|
||||
|
||||
override string getARelevantTag() { result = ["hasLocalValueFlow", "hasLocalTaintFlow"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasLocalValueFlow" and
|
||||
exists(DataFlow::Node sink | LocalValueFlow::flowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -49,3 +47,5 @@ class LocalFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<LocalFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -22,12 +22,10 @@ module RemoteTaintConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module RemoteTaintFlow = TaintTracking::Global<RemoteTaintConfig>;
|
||||
|
||||
class RemoteFlowTest extends InlineExpectationsTest {
|
||||
RemoteFlowTest() { this = "RemoteFlowTest" }
|
||||
module RemoteFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = ["hasRemoteValueFlow", "hasRemoteTaintFlow"] }
|
||||
|
||||
override string getARelevantTag() { result = ["hasRemoteValueFlow", "hasRemoteTaintFlow"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasRemoteValueFlow" and
|
||||
exists(DataFlow::Node sink | RemoteValueFlow::flowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
@@ -45,3 +43,5 @@ class RemoteFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<RemoteFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -3,10 +3,8 @@ import semmle.code.java.frameworks.JaxWS
|
||||
import semmle.code.java.security.XSS
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class JaxRsTest extends InlineExpectationsTest {
|
||||
JaxRsTest() { this = "JaxRsTest" }
|
||||
|
||||
override string getARelevantTag() {
|
||||
module JaxRsTest implements TestSig {
|
||||
string getARelevantTag() {
|
||||
result =
|
||||
[
|
||||
"ResourceMethod", "RootResourceClass", "NonRootResourceClass",
|
||||
@@ -18,7 +16,7 @@ class JaxRsTest extends InlineExpectationsTest {
|
||||
]
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "ResourceMethod" and
|
||||
exists(JaxRsResourceMethod resourceMethod |
|
||||
resourceMethod.getLocation() = location and
|
||||
@@ -168,3 +166,5 @@ class JaxRsTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<JaxRsTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import java
|
||||
import semmle.code.java.frameworks.JaxWS
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class JaxWsEndpointTest extends InlineExpectationsTest {
|
||||
JaxWsEndpointTest() { this = "JaxWsEndpointTest" }
|
||||
module JaxWsEndpointTest implements TestSig {
|
||||
string getARelevantTag() { result = ["JaxWsEndpoint", "JaxWsEndpointRemoteMethod"] }
|
||||
|
||||
override string getARelevantTag() { result = ["JaxWsEndpoint", "JaxWsEndpointRemoteMethod"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "JaxWsEndpoint" and
|
||||
exists(JaxWsEndpoint jaxWsEndpoint |
|
||||
jaxWsEndpoint.getLocation() = location and
|
||||
@@ -25,3 +23,5 @@ class JaxWsEndpointTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<JaxWsEndpointTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -14,12 +14,10 @@ module Config implements DataFlow::ConfigSig {
|
||||
|
||||
module Flow = TaintTracking::Global<Config>;
|
||||
|
||||
class FlowStepTest extends InlineExpectationsTest {
|
||||
FlowStepTest() { this = "FlowStepTest" }
|
||||
module FlowStepTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintReachesReturn" }
|
||||
|
||||
override string getARelevantTag() { result = "taintReachesReturn" }
|
||||
|
||||
override predicate hasActualResult(Location l, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location l, string element, string tag, string value) {
|
||||
tag = "taintReachesReturn" and
|
||||
value = "" and
|
||||
exists(DataFlow::Node source | Flow::flow(source, _) |
|
||||
@@ -28,3 +26,5 @@ class FlowStepTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<FlowStepTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -14,12 +14,10 @@ module Config implements DataFlow::ConfigSig {
|
||||
|
||||
module Flow = TaintTracking::Global<Config>;
|
||||
|
||||
class SinkTest extends InlineExpectationsTest {
|
||||
SinkTest() { this = "SinkTest" }
|
||||
module SinkTest implements TestSig {
|
||||
string getARelevantTag() { result = "taintReachesSink" }
|
||||
|
||||
override string getARelevantTag() { result = "taintReachesSink" }
|
||||
|
||||
override predicate hasActualResult(Location l, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location l, string element, string tag, string value) {
|
||||
tag = "taintReachesSink" and
|
||||
value = "" and
|
||||
exists(DataFlow::Node source | Flow::flow(source, _) |
|
||||
@@ -28,3 +26,5 @@ class SinkTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<SinkTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -24,12 +24,10 @@ module ValueFlowConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module ValueFlow = DataFlow::Global<ValueFlowConfig>;
|
||||
|
||||
class HasFlowTest extends InlineExpectationsTest {
|
||||
HasFlowTest() { this = "HasFlowTest" }
|
||||
module HasFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = ["numTaintFlow", "numValueFlow"] }
|
||||
|
||||
override string getARelevantTag() { result = ["numTaintFlow", "numValueFlow"] }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "numTaintFlow" and
|
||||
exists(DataFlow::Node src, DataFlow::Node sink, int num | TaintFlow::flow(src, sink) |
|
||||
not ValueFlow::flow(src, sink) and
|
||||
@@ -48,3 +46,5 @@ class HasFlowTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<HasFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -14,15 +14,15 @@ module TestConfig implements DataFlow::ConfigSig {
|
||||
|
||||
module TestFlow = TaintTracking::Global<TestConfig>;
|
||||
|
||||
class JmsFlowTest extends InlineExpectationsTest {
|
||||
JmsFlowTest() { this = "JmsFlowTest" }
|
||||
module JmsFlowTest implements TestSig {
|
||||
string getARelevantTag() { result = "tainted" }
|
||||
|
||||
override string getARelevantTag() { result = "tainted" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "tainted" and
|
||||
exists(TestFlow::PathNode sink | TestFlow::flowPath(_, sink) |
|
||||
location = sink.getNode().getLocation() and element = sink.getNode().toString() and value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<JmsFlowTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,15 +2,15 @@ import java
|
||||
import semmle.code.java.dataflow.FlowSources
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class JmsRemoteSourcesTest extends InlineExpectationsTest {
|
||||
JmsRemoteSourcesTest() { this = "JmsRemoteSourcesTest" }
|
||||
module JmsRemoteSourcesTest implements TestSig {
|
||||
string getARelevantTag() { result = "source" }
|
||||
|
||||
override string getARelevantTag() { result = "source" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "source" and
|
||||
exists(RemoteFlowSource source |
|
||||
location = source.getLocation() and element = source.toString() and value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<JmsRemoteSourcesTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -2,12 +2,10 @@ import java
|
||||
import semmle.code.java.dataflow.FlowSources
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class SourceTest extends InlineExpectationsTest {
|
||||
SourceTest() { this = "SourceTest" }
|
||||
module SourceTest implements TestSig {
|
||||
string getARelevantTag() { result = "source" }
|
||||
|
||||
override string getARelevantTag() { result = "source" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "source" and
|
||||
exists(RemoteFlowSource source |
|
||||
not source.asParameter().getCallable().getDeclaringType().hasName("DefaultConsumer") and
|
||||
@@ -17,3 +15,5 @@ class SourceTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<SourceTest>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
|
||||
@@ -4,12 +4,10 @@ import semmle.code.java.dataflow.DataFlow
|
||||
import semmle.code.java.dataflow.ExternalFlow
|
||||
import semmle.code.java.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
|
||||
|
||||
class SinkTest extends InlineExpectationsTest {
|
||||
SinkTest() { this = "SinkTest" }
|
||||
module SinkTest implements TestSig {
|
||||
string getARelevantTag() { result = "isSink" }
|
||||
|
||||
override string getARelevantTag() { result = "isSink" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "isSink" and
|
||||
exists(DataFlow::Node sink |
|
||||
sinkNode(sink, _) and
|
||||
@@ -20,12 +18,10 @@ class SinkTest extends InlineExpectationsTest {
|
||||
}
|
||||
}
|
||||
|
||||
class NeutralSinkTest extends InlineExpectationsTest {
|
||||
NeutralSinkTest() { this = "NeutralSinkTest" }
|
||||
module NeutralSinkTest implements TestSig {
|
||||
string getARelevantTag() { result = "isNeutralSink" }
|
||||
|
||||
override string getARelevantTag() { result = "isNeutralSink" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "isNeutralSink" and
|
||||
exists(Call call, Callable callable |
|
||||
call.getCallee() = callable and
|
||||
@@ -38,3 +34,5 @@ class NeutralSinkTest extends InlineExpectationsTest {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import MakeTest<MergeTests<SinkTest, NeutralSinkTest>>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user