Java: add taint-tracking config for execute to exclude FPs from non-update queries like select

This commit is contained in:
Jami Cogswell
2024-12-12 16:19:36 -05:00
parent 97aaf4c011
commit 0f39011122
4 changed files with 84 additions and 16 deletions

View File

@@ -15,9 +15,9 @@
import java
import semmle.code.java.security.CsrfUnprotectedRequestTypeQuery
query predicate edges(PathNode pred, PathNode succ) { CallGraph::edges(pred, succ) }
query predicate edges(CallPathNode pred, CallPathNode succ) { CallGraph::edges(pred, succ) }
from PathNode source, PathNode reachable, PathNode callsReachable
from CallPathNode source, CallPathNode reachable, CallPathNode callsReachable
where unprotectedStateChange(source, reachable, callsReachable)
select source.asMethod(), source, callsReachable,
"Potential CSRF vulnerability due to using an HTTP request type which is not default-protected from CSRF for an apparent $@.",