mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Factor request-forgery config so it can be used in an inline-expectations test
This commit is contained in:
18
java/ql/test/query-tests/security/CWE-918/RequestForgery.ql
Normal file
18
java/ql/test/query-tests/security/CWE-918/RequestForgery.ql
Normal file
@@ -0,0 +1,18 @@
|
||||
import java
|
||||
import semmle.code.java.security.RequestForgeryConfig
|
||||
import TestUtilities.InlineExpectationsTest
|
||||
|
||||
class HasFlowTest extends InlineExpectationsTest {
|
||||
HasFlowTest() { this = "HasFlowTest" }
|
||||
|
||||
override string getARelevantTag() { result = "SSRF" }
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "SSRF" and
|
||||
exists(RequestForgeryConfiguration conf, DataFlow::Node sink | conf.hasFlowTo(sink) |
|
||||
sink.getLocation() = location and
|
||||
element = sink.toString() and
|
||||
value = ""
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user