mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Merge pull request #13380 from asgerf/js/fix-sink-kind
JS: Fix invalid source kind in test
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
commandInjectionSinks
|
||||
| execa.example.js:2:7:2:9 | cmd |
|
||||
sqlInjectionSinks
|
||||
| connection.example.ts:4:20:4:20 | q |
|
||||
| connection.example.ts:9:18:9:18 | q |
|
||||
remoteFlowSources
|
||||
| message.example.js:1:46:1:50 | event |
|
||||
@@ -1,11 +0,0 @@
|
||||
import javascript
|
||||
private import semmle.javascript.security.dataflow.CommandInjectionCustomizations
|
||||
private import semmle.javascript.security.dataflow.SqlInjectionCustomizations
|
||||
|
||||
query predicate commandInjectionSinks(DataFlow::Node node) {
|
||||
node instanceof CommandInjection::Sink
|
||||
}
|
||||
|
||||
query predicate sqlInjectionSinks(DataFlow::Node node) { node instanceof SqlInjection::Sink }
|
||||
|
||||
query predicate remoteFlowSources(RemoteFlowSource node) { any() }
|
||||
@@ -0,0 +1,2 @@
|
||||
| connection.example.ts:4:20:4:20 | q |
|
||||
| connection.example.ts:9:18:9:18 | q |
|
||||
@@ -0,0 +1,4 @@
|
||||
import javascript
|
||||
private import semmle.javascript.security.dataflow.SqlInjectionCustomizations
|
||||
|
||||
query predicate sqlInjectionSinks(DataFlow::Node node) { node instanceof SqlInjection::Sink }
|
||||
@@ -0,0 +1 @@
|
||||
| execa.example.js:2:7:2:9 | cmd |
|
||||
@@ -0,0 +1,6 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/javascript-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- ["@example/execa", "Member[shell].Argument[0]", "command-injection"]
|
||||
@@ -1,10 +0,0 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/javascript-all
|
||||
extensible: sinkModel
|
||||
data:
|
||||
- [
|
||||
"@example/execa",
|
||||
"Member[shell].Argument[0]",
|
||||
"command-injection",
|
||||
]
|
||||
6
javascript/ql/test/library-tests/DataExtensions/execa.ql
Normal file
6
javascript/ql/test/library-tests/DataExtensions/execa.ql
Normal file
@@ -0,0 +1,6 @@
|
||||
import javascript
|
||||
private import semmle.javascript.security.dataflow.CommandInjectionCustomizations
|
||||
|
||||
query predicate commandInjectionSinks(DataFlow::Node node) {
|
||||
node instanceof CommandInjection::Sink
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
| message.example.js:1:46:1:50 | event |
|
||||
| message.example.js:2:16:2:25 | event.data |
|
||||
@@ -6,5 +6,5 @@ extensions:
|
||||
- [
|
||||
"global",
|
||||
"Member[addEventListener].WithStringArgument[0=message].Argument[1].Parameter[0].Member[data]",
|
||||
"remote-flow",
|
||||
"remote",
|
||||
]
|
||||
@@ -0,0 +1,3 @@
|
||||
import javascript
|
||||
|
||||
query predicate remoteFlowSources(RemoteFlowSource node) { any() }
|
||||
@@ -5,6 +5,4 @@ dependencies:
|
||||
codeql/javascript-queries: ${workspace}
|
||||
extractor: javascript
|
||||
tests: .
|
||||
dataExtensions:
|
||||
- library-tests/DataExtensions/*.model.yml
|
||||
warnOnImplicitThis: true
|
||||
|
||||
Reference in New Issue
Block a user