Commit 4ab6262
Apply the value check to every option key, not just passthrough ones
Review round 1. The flag-like-value guard lived in addUserArg(), which
only runs for keys reaching the default: branch, so all 21 options with
an explicit switch case bypassed it. Because the binary's parser accepts
the '--flag=value' form, the smuggled flag carries its own value and
needs no following argv slot:
{localIdentifier: '--log-file=/tmp/attacker-owned'}
-> [..., '--local-identifier', '--log-file=/tmp/attacker-owned']
which the parser reads as a second --log-file. Reachable the same way
through only, folder, proxyHost/Port/User/Pass, parallelRuns,
useCaCertificate, logFile, key and verbose — i.e. through exactly the
keys the README documents. That also defeated RESERVED_OPTIONS, since
--daemon= and --log-file= could ride in as values.
Hoist the check into addArgs, above the switch, so it applies to every
key. List-valued options (--include-hosts, --exclude-hosts) take an
array, so every element is checked, not just the first.
Also from review:
- skip a null/undefined passthrough value, matching the `if(value)`
guard every explicit case already uses, and push a coerced string so
no non-string argv element reaches execFile/spawnSync; array values
are pushed as separate elements, which is what a list flag expects
- note in PASSTHROUGH_OPTIONS that the entries shadowed by an explicit
case are listed for completeness against the binary's CLI, and make
the log-file/logFile split explicit rather than contradictory
- drop the internal tracker ids from the test comment; this repo is
public and no such id currently ships in the tree
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 1964cb1 commit 4ab6262
2 files changed
Lines changed: 106 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| |||
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
59 | | - | |
60 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
| |||
208 | 216 | | |
209 | 217 | | |
210 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
211 | 228 | | |
212 | 229 | | |
213 | 230 | | |
| |||
313 | 330 | | |
314 | 331 | | |
315 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
316 | 346 | | |
317 | 347 | | |
318 | 348 | | |
319 | 349 | | |
| 350 | + | |
320 | 351 | | |
321 | 352 | | |
322 | 353 | | |
| |||
327 | 358 | | |
328 | 359 | | |
329 | 360 | | |
330 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
331 | 364 | | |
332 | | - | |
| 365 | + | |
333 | 366 | | |
334 | 367 | | |
335 | 368 | | |
336 | 369 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
| 370 | + | |
342 | 371 | | |
343 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
344 | 379 | | |
345 | 380 | | |
346 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
185 | 241 | | |
186 | 242 | | |
187 | 243 | | |
| |||
0 commit comments