Skip to content

Commit 7880e9e

Browse files
Jami CogswellJami Cogswell
authored andcommitted
JS: update 'command-line-injection' sink kind to 'command-injection'
1 parent 2dcdc71 commit 7880e9e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Note that this sink is already recognized by the CodeQL JS analysis, but for thi
5353
pack: codeql/javascript-all
5454
extensible: sinkModel
5555
data:
56-
- ["execa", "Member[shell].Argument[0]", "command-line-injection"]
56+
- ["execa", "Member[shell].Argument[0]", "command-injection"]
5757
5858
5959
- Since we're adding a new sink, we add a tuple to the **sinkModel** extensible predicate.
@@ -64,7 +64,7 @@ Note that this sink is already recognized by the CodeQL JS analysis, but for thi
6464
- **Member[shell]** selects accesses to the **shell** member of the **execa** package.
6565
- **Argument[0]** selects the first argument to calls to that member.
6666

67-
- **command-line-injection** indicates that this is considered a sink for the command injection query.
67+
- **command-injection** indicates that this is considered a sink for the command injection query.
6868

6969
Example: Taint sources from window 'message' events
7070
---------------------------------------------------
@@ -463,7 +463,7 @@ Sink kinds
463463
Unlike sources, sinks tend to be highly query-specific, rarely affecting more than one or two queries. Not every query supports customizable sinks. If the following sinks are not suitable for your use case, you should add a new query.
464464

465465
- **code-injection**: A sink that can be used to inject code, such as in calls to **eval**.
466-
- **command-line-injection**: A sink that can be used to inject shell commands, such as in calls to **child_process.spawn**.
466+
- **command-injection**: A sink that can be used to inject shell commands, such as in calls to **child_process.spawn**.
467467
- **path-injection**: A sink that can be used for path injection in a file system access, such as in calls to **fs.readFile**.
468468
- **sql-injection**: A sink that can be used for SQL injection, such as in a MySQL **query** call.
469469
- **nosql-injection**: A sink that can be used for NoSQL injection, such as in a MongoDB **findOne** call.

javascript/ql/lib/semmle/javascript/security/dataflow/CommandInjectionCustomizations.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ module CommandInjection {
4949
}
5050

5151
private class SinkFromModel extends Sink {
52-
SinkFromModel() { this = ModelOutput::getASinkNode("command-line-injection").asSink() }
52+
SinkFromModel() { this = ModelOutput::getASinkNode("command-injection").asSink() }
5353
}
5454
}

javascript/ql/test/library-tests/DataExtensions/execa.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ extensions:
66
- [
77
"@example/execa",
88
"Member[shell].Argument[0]",
9-
"command-line-injection",
9+
"command-injection",
1010
]

0 commit comments

Comments
 (0)