Java: Improve java/spring-disabled-csrf-protection

This commit is contained in:
Tony Torralba
2023-10-16 15:49:25 +02:00
parent 1297acf5b1
commit d08ee76b16
10 changed files with 78 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
import java
import semmle.code.java.security.SpringCsrfProtection
import TestUtilities.InlineExpectationsTest
module SpringCsrfProtectionTest implements TestSig {
string getARelevantTag() { result = "hasSpringCsrfProtectionDisabled" }
predicate hasActualResult(Location location, string element, string tag, string value) {
tag = "hasSpringCsrfProtectionDisabled" and
exists(MethodAccess call | disablesSpringCsrfProtection(call) |
call.getLocation() = location and
element = call.toString() and
value = ""
)
}
}
import MakeTest<SpringCsrfProtectionTest>