Commit d65a1fe
fix(build): use execFileSync (no shell) in build scripts to resolve CodeQL shell-injection alerts
Replace string-form execSync invocations with array-form execFileSync (no
shell) at two build-tooling call sites flagged by CodeQL
js/shell-command-injection-from-environment:
- scripts/build-modules.js: prettier --write now runs via
execFileSync(process.execPath, [require.resolve("prettier/bin/prettier.cjs"),
"--write", join(BUILTIN_DIR, "*.js")]). Prettier expands the glob itself, so
no shell parses the interpolated path.
- scripts/bash-bundle/build.mjs: esbuild now runs via
execFileSync(process.execPath, [require.resolve("esbuild/bin/esbuild"), ...])
with each flag/value as its own array element (aliasArgs kept as an array
instead of space-joined). Same flags, aliases, --minify, --tree-shaking, and
outfile — behaviour is identical.
Build tooling only; generated artifacts are unchanged byte-for-byte. Resolves
CodeQL alerts #2 and #11.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent 1a7ea63 commit d65a1fe
2 files changed
Lines changed: 38 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
75 | 87 | | |
76 | 88 | | |
77 | 89 | | |
| |||
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
164 | | - | |
165 | 176 | | |
0 commit comments