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

Abierto
#4,287 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #4309 de @atharva081106 — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
53/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, typescript
Área
security, tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
143k
Forks
21k
Merge medio
5 h 25 min
PR fusionados (30 d)
791

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de garrytan/gstack

Todos los issues de garrytan/gstack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.