pregate secrets: env.kv flags a TypeScript template literal made of ${…} slots and a fixed word

Aperta
#4,287 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #4309 di @atharva081106 — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
53/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, typescript
Ambito
security, tooling

Direzione di ricerca

Start by tracing the gstack-pregate secrets check into gstack-redact's env.kv detection, then compare how Python f-string and Dart ${…} fields are handled for GST-738 and how TypeScript dictionary entries are exempted for #3630. Reproduce the reported template literal and check that ordinary low-entropy text is exempt while credential-shaped text such as sk-… and AKIA… still reports.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug S3

What happened

gstack-pregate's secrets check (gstack-redact, finding env.kv, "secret-named assignment, high entropy") fails on an added TypeScript line whose value is a template literal built only from interpolations and a fixed word:

key: `${over.day}|${over.groomerId}|over_tough|`,

The value is a cache/list key, not a credential: every character outside the ${…} slots is a literal (|over_tough|). The same shape on lines already on the base isn't reported, only because those lines aren't added.

Why it matters

secrets can't be downgraded, so the only way through is an allowlist entry, which must first land on the base. One false positive on an ordinary TypeScript line costs a separate PR and a review cycle.

Suggestion

Treat a TypeScript/JavaScript template literal's ${…} slots as code, the way Python f-string fields and Dart ${…} are already read as code (GST-738), and the way TypeScript dict entries that read a name are exempt (#3630). A template literal whose non-interpolated text is short or low-entropy and has no credential-shaped run could then be exempt from env.kv, while a literal containing a real key shape (sk-…, AKIA…) still reports.

Seen on gstack 1.99.0.0. The repository is private, so no link to the PR.

Lingua principale
TypeScript
Stelle
143k
Fork
21k
Merge medio
5h 25m
PR unite (30g)
791

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di garrytan/gstack

Tutte le issue di garrytan/gstack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.