Commit 9101cb7
committed
Fix: install -t<dir> attached short bypass (sec 114, FN, Codex sweep 5 Q4)
The install walker has its own in-line flag-skip loop that
discards every `-*` token (except for the explicit
`--target-directory=val` long form). Attached `install -t/tmp
src dst` therefore landed in the generic skip branch and
never reached the boundary check — install proceeded to copy
into `/tmp` with no validation.
Verified locally before fix:
install -t/tmp src.txt dst.txt # ALLOW (bypass)
install -t /tmp src.txt # BLOCK (positional walk catches /tmp)
install --target-directory=/tmp # BLOCK (explicit long form)
Patch: in the install walker's `-*` arm, recognise `-t?*`
attached form before the generic continue-skip and validate
the value via `validate_command_path strict "install -t"`.
The split form keeps working because the next-token positional
walk already validates `/tmp` as a target — no change needed
there.
Tests: sec 114 in test_bypass_reproducers_pentest_d.sh — two
outside-project attached shapes block; in-project attached
allowed.
Regression: tests/test_guard.sh — 1579/1579.
Pre-existing gap; surfaced by Codex sweep 5 Q4. Not introduced
by 939c9f4 (extract_option_values is not called from the
install walker — install has its own flag-handling code).1 parent b058a57 commit 9101cb7
2 files changed
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
0 commit comments