mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
Java: add name-based heuristic
This commit is contained in:
@@ -211,4 +211,10 @@ public class CsrfUnprotectedRequestTypeTest {
|
||||
public void bad10(@RequestParam String user) { // $ hasCsrfUnprotectedRequestType
|
||||
myBatisService.bad10(user);
|
||||
}
|
||||
|
||||
// BAD: method name implies a state-change
|
||||
@GetMapping(value = "delete")
|
||||
public String delete(@RequestParam String user) { // $ hasCsrfUnprotectedRequestType
|
||||
return "delete";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@ module CsrfUnprotectedRequestTypeTest implements TestSig {
|
||||
|
||||
predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
tag = "hasCsrfUnprotectedRequestType" and
|
||||
exists(CallPathNode src, CallPathNode sink, CallPathNode sinkPred |
|
||||
unprotectedStateChange(src, sink, sinkPred)
|
||||
|
|
||||
exists(CallPathNode src, CallPathNode sink | unprotectedStateChange(src, sink) |
|
||||
src.getLocation() = location and
|
||||
element = src.toString() and
|
||||
value = ""
|
||||
|
||||
Reference in New Issue
Block a user