Commit 5ea6602
security: harden regex escaping and variable expansion
Additional security hardening for release skill:
1. Escape VERSION in sed regex:
- Added regex metacharacter escaping for VERSION variable
- Prevents unintended pattern matching if VERSION contains
special characters like . + * ( ) [ ] etc.
- Creates ESCAPED_VERSION before use in sed pattern
2. Properly quote PRERELEASE variable:
- Replaced parameter expansion with explicit if/else
- Ensures PRERELEASE is always properly quoted
- Prevents word splitting or glob expansion issues
These changes address the medium-severity issues identified in
the security review.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 344abd6 commit 5ea6602
1 file changed
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
| |||
0 commit comments