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

Security: fetch-retry final log still includes `init.body` — leaks refresh tokens after #598 removed headers

Chiusa Adatta ai principianti
#635 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@benjamincanac ci sta già lavorando.

Dal 11/10/2026.

  • #647 di @benjamincanac — aperta

Valutazione

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

Direzione di ricerca

Inizia in src/runtime/utils/fetch-retry.ts e ispeziona il logging del tentativo finale descritto nell’issue. Riproduci una richiesta con un body sensibile che fallisca dopo tutti i tentativi e verifica quindi che l’errore finale della console ometta il body, mantenendo però l’errore di fetch.

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

Descrizione

Stale
Version

@nuxtjs/supabase 2.0.9 (current main)

Summary

#598 / PR #599 removed headers from the final-failure log in src/runtime/utils/fetch-retry.ts, but the rest of init is still logged — and that includes init.body:

if (attempt === retries) {
  const { headers: _headers, ...safeInit } = init ?? {}
  console.error(`Error fetching request ${req}`, error, safeInit)
  throw error
}

For requests supabase-js sends to /auth/v1/token, init.body contains credentials:

  • ?grant_type=refresh_token → {"refresh_token":"..."}
  • ?grant_type=password → the user's email and password

So the body has the same failure mode #598 fixed for headers: any auth request that fails all 3 retries (network blip, device offline, rate limit) logs the credential via console.error, and any runtime that captures console output persists it — Sentry's default console breadcrumbs attach it to captured events, and the same applies to Cloudflare Workers Observability, Vercel log drains, and stdout shipping.

A leaked refresh token is a live session: it can be exchanged for a fresh access + refresh token pair by anyone with read access to the logging destination.

Reproduction

Any request with a sensitive body that fails 3 times, e.g. go offline (or block *.supabase.co) with a session due for refresh; the final attempt logs {"method":"POST","body":"{\"refresh_token\":\"...\"}"}.

Proposed fix

Extend the #599 destructure by one key:

const { headers: _headers, body: _body, ...safeInit } = init ?? {}

The body is never useful for diagnosing a fetch failure (the error carries the cause), so there's nothing to redact selectively.

Happy to open a PR.

Lingua principale
TypeScript
Stelle
940
Fork
157
Merge medio
6g 9h
PR unite (30g)
3

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 nuxt-modules/supabase

Tutte le issue di nuxt-modules/supabase

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.