mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
18 lines
653 B
Plaintext
18 lines
653 B
Plaintext
import javascript
|
|
import semmle.javascript.security.dataflow.RequestForgeryQuery as RequestForgery
|
|
import semmle.javascript.security.dataflow.ClientSideRequestForgeryQuery as ClientSideRequestForgery
|
|
import utils.test.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)
|
|
)
|
|
}
|