Commit 9bf3c21
fix: harden provision.sh against command injection in env_b64 and app_name (#2444)
- Validate app_name at function entry (alphanumeric, dots, hyphens, underscores
only) before it's used in file paths or passed to cloud_exec
- Add trap-based cleanup for the temp file used during .spawnrc fallback creation
- Add security comments documenting the three-layer defense model: printf %q
quoting, base64 encoding, and stdin piping (no interpolation into command
strings)
The core vulnerability (env_b64 interpolated into the cloud_exec command string)
was already fixed in a prior commit that switched to stdin piping. This change
adds defense-in-depth and documentation.
Fixes #2437, #2441
Agent: code-health
Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a22fe90 commit 9bf3c21
1 file changed
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
176 | 183 | | |
177 | 184 | | |
178 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
179 | 190 | | |
180 | 191 | | |
| 192 | + | |
181 | 193 | | |
182 | 194 | | |
183 | 195 | | |
| |||
220 | 232 | | |
221 | 233 | | |
222 | 234 | | |
223 | | - | |
| 235 | + | |
| 236 | + | |
224 | 237 | | |
225 | 238 | | |
226 | | - | |
227 | 239 | | |
228 | 240 | | |
229 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
230 | 246 | | |
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
234 | 250 | | |
235 | 251 | | |
236 | 252 | | |
237 | | - | |
238 | 253 | | |
239 | 254 | | |
0 commit comments