Skip to content

Commit c8afce7

Browse files
committed
docs: correct the exec.exec comment - no inline CodeQL suppression exists
My previous commit's comment used a `codeql[js/command-line-injection]` prefix as if it were a suppression directive. Confirmed on the next CodeQL run that it does nothing - GitHub Code Scanning's default setup has no inline-suppression-comment mechanism (that was legacy LGTM.com behavior, not something the current product supports). Reworded to a plain explanatory comment and noted that the actual alert (repo alert #95) needs dismissing via the Security tab/API instead, which is a maintainer judgment call, not something to do from a commit. No functional change - comment only.
1 parent b3b4352 commit c8afce7

3 files changed

Lines changed: 23 additions & 19 deletions

File tree

dist/index.js

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ export async function run() {
4040
getInput: (name) => (name === 'projectPath' ? projectPath : core.getInput(name)),
4141
});
4242

43-
// codeql[js/command-line-injection] - args is an array of discrete argv
44-
// entries, not a concatenated shell string, and @actions/exec's
45-
// toolrunner.js passes it straight to child_process.spawn(fileName, args,
46-
// options) (verified by reading node_modules/@actions/exec/lib/toolrunner.js)
47-
// - no shell is ever invoked to (mis)parse it, so classic shell/command
48-
// injection via metacharacters isn't reachable here. CodeQL's static
49-
// analysis can't see through @actions/exec's internals to confirm that,
50-
// which is why it still flags this generic "user input reaches an
51-
// exec-family call" pattern.
43+
// CodeQL flags this line (js/command-line-injection) since args
44+
// ultimately derives from Action inputs. Verified false positive: args
45+
// is an array of discrete argv entries, not a concatenated shell
46+
// string, and @actions/exec's toolrunner.js passes it straight to
47+
// child_process.spawn(fileName, args, options) - verified by reading
48+
// node_modules/@actions/exec/lib/toolrunner.js - never a shell string,
49+
// never shell-parsed. CodeQL's static analysis can't see through
50+
// @actions/exec's internals to confirm that. This comment does not
51+
// suppress the alert (GitHub Code Scanning's default setup has no
52+
// inline-suppression-comment mechanism - that was legacy LGTM.com
53+
// behavior); the alert needs dismissing via the Security tab/API.
5254
const exitCode = await exec.exec(cliPath, args, { ignoreReturnCode: true });
5355

5456
// Matches the original action's engineExitCode output: 0 on success,

0 commit comments

Comments
 (0)