Commit b47c4e6
fix(security): remove eval from conformance runner
The conformance/run_conformance.sh script previously built a parser
command as a string and invoked it via `eval "${PARSER}" "$f"`, which
is a command-injection vector: a caller could pass $1 containing shell
metacharacters and execute arbitrary commands as whoever runs the
script.
Fix: build PARSER_CMD as a Bash array. If the caller passes a parser
command as $1, split it on whitespace into the array; otherwise use the
default parser invocation as array literals directly. Invoke via
`"${PARSER_CMD[@]}" "$f"` — no eval, no shell re-parsing.
This is the same fix applied to my-lang/conformance/run_conformance.sh
and is being rolled out across all language repos in the
nextgen-languages monorepo that share the same original script pattern.
Resolves one Critical panic-attack CommandInjection finding.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8ccc2f9 commit b47c4e6
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
18 | 26 | | |
19 | 27 | | |
| |||
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | | - | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | | - | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
0 commit comments