mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
JS: Add consistency test
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
consistencyIssue
|
||||
resultInWrongFile
|
||||
@@ -0,0 +1,17 @@
|
||||
import javascript
|
||||
import semmle.javascript.security.dataflow.RequestForgeryQuery as RequestForgery
|
||||
import semmle.javascript.security.dataflow.ClientSideRequestForgeryQuery as ClientSideRequestForgery
|
||||
import testUtilities.ConsistencyChecking
|
||||
|
||||
query predicate resultInWrongFile(DataFlow::Node node) {
|
||||
exists(DataFlow::Configuration cfg, string filePattern |
|
||||
cfg instanceof RequestForgery::Configuration and
|
||||
filePattern = ".*serverSide.*"
|
||||
or
|
||||
cfg instanceof ClientSideRequestForgery::Configuration and
|
||||
filePattern = ".*clientSide.*"
|
||||
|
|
||||
cfg.hasFlow(_, node) and
|
||||
not node.getFile().getRelativePath().regexpMatch(filePattern)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user