Commit e69de0f
committed
fix: prevent code injection in handle-fix-commit action
Resolve 6 medium-severity code injection alerts (CodeQL #107, #105, #104, #103, #102, #100)
in .github/actions/handle-fix-commit/action.yaml by moving user inputs to environment
variables before use in shell commands.
This follows GitHub Security Lab best practices for preventing code injection in
GitHub Actions workflows:
https://securitylab.github.com/research/github-actions-untrusted-input/
Changes:
- Added env: section mapping all user inputs to environment variables
- Updated shell script to use $VAR syntax instead of ${{ inputs.X }} syntax
- Properly quoted all variable references to prevent word splitting
Inputs affected:
- inputs.token → $TOKEN
- inputs.tool → $TOOL
- inputs.retry-attempts → $RETRY_ATTEMPTS
- inputs.pr-info-ref → $PR_REF1 parent c66e143 commit e69de0f
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | | - | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
93 | | - | |
| 98 | + | |
94 | 99 | | |
95 | | - | |
96 | | - | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| |||
102 | 107 | | |
103 | 108 | | |
104 | 109 | | |
105 | | - | |
| 110 | + | |
106 | 111 | | |
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
110 | | - | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| |||
0 commit comments