Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bug] Session traces persist API credentials in plaintext headers

Chiusa
#118 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
security

Direzione di ricerca

Start at buildTraceRecord and cloneRequestHeaders, then inspect FetchHttpTransport and SessionTraceStore, using the isolated production-transport regression test described in the issue. Verify that persisted trace JSON redacts authorization, x-api-key, and response cookies across header casing, response status, and streaming mode while credentials still reach the endpoint.

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

Descrizione

Version and environment

main at 87c344501f5960cda6bf9f47eec5af0a4664cdba (1.0.0), Node.js 26.8.1, macOS 26.5.2 arm64.

Reproduction
  1. Create a FetchHttpTransport with a real SessionTraceStore targeting a temporary storage root.
  2. Send a request with complete trace metadata and dummy authorization: Bearer fake-key-for-regression-only / x-api-key: fake-anthropic-key headers. Mock only the fetch response; do not use real credentials or call a model endpoint.
  3. Read the generated sessions/s1/trace/span1.json.
  4. Both dummy credentials appear verbatim in request.headers.
Expected behavior

Authentication credentials should reach the model endpoint but be redacted from persisted diagnostic headers, regardless of header-name casing, response status, or streaming mode.

Actual behavior and cause

buildTraceRecord copies request headers with cloneRequestHeaders without redaction. OpenAI-compatible requests contain a bearer token and Anthropic requests contain x-api-key. Session tracing is enabled by default in BUILTIN_CLI_DEFAULTS.

Trace files use mode 0600, so this is not a claim of unauthenticated remote access. The problem is that diagnostic files contain reusable API credentials and can disclose them if copied or shared. Response cookies should likewise be redacted from trace headers.

Verification

An isolated regression test using the production transport and filesystem trace store fails on current main because the saved JSON contains the dummy credential.

  • Searched existing issues and PRs for duplicates.
  • Read CONTRIBUTING.md.
Lingua principale
TypeScript
Stelle
471
Fork
42
Merge medio
18h 11m
PR unite (30g)
22

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 stepfun-ai/Step-Code

Tutte le issue di stepfun-ai/Step-Code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.