Repository navigation
Commit 997c273
fix(scripts): close $-leading secret bypass in sensitive-terms lookahead
The lookahead added in 94674a3 to skip runtime secret reads ($(...),
$VAR) sat one char after the quote and skipped ANY value starting with
$ or backtick — so a hardcoded literal that merely begins with $
(e.g. password="$3cr3tLiteral") escaped detection, a real bypass in
secret-scanning code (flagged in #220 review).
Tighten the negative lookahead to match only the var-ref / cmd-sub
SHAPES it actually means — ${... | $(... | $<letter|underscore>
| backtick — not merely a leading $/backtick. A literal starting with
$ + digit is a valid shell literal (not a var ref) and is still flagged.
Add a regression test for the $-leading-literal case so the limitation
is documented, not accidental.
Co-authored-by: OpenCode Agent <[email protected]>1 parent 94674a3 commit 997c273
2 files changed
Lines changed: 34 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| |||
0 commit comments