File tree Expand file tree Collapse file tree
codeql/custom-queries-javascript Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import javascript
2+
3+ // https://codeql.github.com/docs/codeql-language-guides/analyzing-data-flow-in-javascript-and-typescript/#sanitizers
4+ // https://codeql.github.com/codeql-standard-libraries/actions/codeql/dataflow/DataFlow.qll/module.DataFlow$Configs$ConfigSig.html
5+ module UtilSanitizerConfig implements DataFlow:: ConfigSig {
6+ /**
7+ * Treat calls to Util.sanitizeShellArg(...) as a barrier/sanitizer for dataflow
8+ */
9+ predicate isBarrier ( DataFlow:: Node nd ) {
10+ nd .( DataFlow:: CallNode ) .getCalleeName ( ) = "Util.sanitizeShellArg"
11+ }
12+ /** Minimal stubs required by ConfigSig (false should be no extra action). */
13+ predicate isSource ( DataFlow:: Node n ) { false }
14+ predicate isSink ( DataFlow:: Node n ) { false }
15+ }
16+
17+ module UtilSanitizerConfigFlow = TaintTracking:: Global< UtilSanitizerConfig > ;
18+
19+ from DataFlow:: Node source , DataFlow:: Node sink
20+ where UtilSanitizerConfigFlow:: flow ( source , sink )
21+ select source , sink
Original file line number Diff line number Diff line change 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/ShellSanitizer.ql
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)
You can’t perform that action at this time.
0 commit comments