Skip to content

Commit 1209b40

Browse files
authored
Merge branch 'master' into hhristov/update-igx-ts-legacy-templates
2 parents b56342b + 70203d6 commit 1209b40

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import javascript
2+
import semmle.javascript.security.dataflow.CommandInjectionCustomizations
3+
4+
5+
// General flow via config https://codeql.github.com/docs/codeql-language-guides/analyzing-data-flow-in-javascript-and-typescript/#sanitizers
6+
// Instead this follows https://github.com/github/codeql/blob/a3e9aed00ae5c1e70da8fbc4fc4a7cc803f177ca/javascript/documentation/library-customization.rst?plain=1#L244-L245
7+
// to modify the pre-defined javascript CommandInjection flow's Sanitizer
8+
9+
/**
10+
* Treat Util.sanitizeShellArg(x) as a sanitizer for shell‑command injection.
11+
*/
12+
class ShellArgSanitizer extends CommandInjection::Sanitizer {
13+
ShellArgSanitizer() {
14+
this.(DataFlow::MethodCallNode).getReceiver().toString() = "Util" and
15+
this.(DataFlow::MethodCallNode).getMethodName() = "sanitizeShellArg"
16+
}
17+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: igniteui-cli-custom-javascript-queries
2+
version: 0.0.0
3+
dependencies:
4+
codeql/javascript-queries: "*"

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
# By default, queries listed here will override any specified in a config file.
5050
# Prefix the list here with "+" to use these queries and those in the config file.
5151
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
queries: ./.github/codeql/custom-queries-javascript
5253

5354
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5455
# If this step fails, then you should remove it and run the build manually (see below)

0 commit comments

Comments
 (0)