[DUP-4] Shell scripts: token-fetch block copy-pasted ×6, banner ×5, validity parsing byte-identical (01/02), secrets visible in argv #39

Closed
opened 2026-11-14 18:29:00 +01:00 by amiryahaya · 1 comment
Owner

Finding

The ~15-line curl+jq token block is identical in 01/02/04/06/07/08; 'Connection Info' banner ×5; --validity parsing (~60 lines) byte-identical between 01 and 02; curl -d "client_secret=…" exposes the secret via ps for the duration of the call (same for Bearer headers).

Evidence

  • e.g. scripts/01_enroll.sh:116-131 vs the same block in 02/04/06/07/08 (diff-verified)

Impact

~150 removable lines; secret leakage to local process listing.

Fix

  • Extract scripts/lib/common.sh (token fetch, banner, validity parsing)
  • Pass secrets via --data @-/curl --config so they never appear in argv

Line numbers refer to the initial import commit 282cb11. Source: comprehensive audit, 2026-11-12 (first review of this codebase).

## Finding The ~15-line curl+jq token block is identical in 01/02/04/06/07/08; 'Connection Info' banner ×5; `--validity` parsing (~60 lines) byte-identical between 01 and 02; `curl -d "client_secret=…"` exposes the secret via `ps` for the duration of the call (same for Bearer headers). ## Evidence - e.g. `scripts/01_enroll.sh:116-131` vs the same block in 02/04/06/07/08 (diff-verified) ## Impact ~150 removable lines; secret leakage to local process listing. ## Fix - [ ] Extract `scripts/lib/common.sh` (token fetch, banner, validity parsing) - [ ] Pass secrets via `--data @-`/curl --config so they never appear in argv _Line numbers refer to the initial import commit `282cb11`. Source: comprehensive audit, 2026-11-12 (first review of this codebase)._
Author
Owner

Verified fixed on main (1b6216b): scripts share scripts/lib/common.sh; secrets go via stdin (B6, PR #59).

Verified fixed on main (1b6216b): scripts share scripts/lib/common.sh; secrets go via stdin (B6, PR #59).
Sign in to join this conversation.
No description provided.