Commit c0e6d9a
committed
fix(workflow): prevent shell injection in grace_period_minutes input
inputs.grace_period_minutes is a free-text string that was previously
interpolated directly into the shell script body, allowing a crafted
value (e.g. "1 $(malicious)") to execute arbitrary commands.
Fix:
- Assign the input to GRACE_PERIOD_INPUT env var so it never reaches
the script body as a template expression.
- Validate with ^[0-9]+$ before use; emit a ::warning:: and skip the
flag if the value is non-numeric.
- Build the argument as a bash array (GRACE_ARGS) so the flag name and
value are always passed as two separate quoted tokens, eliminating
word-splitting and command-substitution risks.
Signed-off-by: SachinduNethmin <108050026+Sachindu-Nethmin@users.noreply.github.com>1 parent e54db43 commit c0e6d9a
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
72 | | - | |
| 77 | + | |
0 commit comments