Factor request-forgery config so it can be used in an inline-expectations test

This commit is contained in:
Chris Smowton
2021-06-09 17:55:34 +01:00
parent ee872f1752
commit b66dcbe5b6
3 changed files with 48 additions and 22 deletions

View 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 = ""
)
}
}