Commit 97be832
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 10cb351 commit 97be832
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
23 | | - | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
0 commit comments