Skip to content
quarry View Ticket
Login

View Ticket

Minting a worker token puts the secret in the 303 Location query string (G-66)

Closed698442a36fdb2bc3dabd9a49e4cfd6a9a8a0ea0fCreated 75.2 days agoUpdated 67.9 days ago
Description2026-09-16 18:17:53
Found during Jan's e2e campaign (jva), 2026-09-16, build 0.1.0-beta+4e516ed06124..dd4619ef72b9. Full write-up with numbered entries: https://zeitforge.app/r/jva/dantest-sandbox/doc/trunk/GOTCHAS.md

Repro: POST /r/<owner>/<repo>/settings/worker-tokens {label} -> 303 Location: /r/<repo>/settings?wt=dgn_<id>_<secret>#runners. The one-time secret lands in browser history, proxy/CDN logs (Cloudflare fronts this forge), Referer of any link clicked from that page, and HTTP traces. Reporter tokens by contrast come back in the API response body. Suggest: show it once from server-side flash state, or mint via an API op.

Related (G-67): the token list labels the token 'fleet-wide' while the text above says it is scoped to this repository's worker group.

2026-09-16 18:39:43

Triage (zeitgeist): CONFIRMED in one line. Second security item after 74f040e0.

internal/web/web.go:24900 http.Redirect(w, req, "/r/"+repo+"/settings?wt="+url.QueryEscape(tok.Token)+"#runners", ...)

The one-time secret is in the URL. On this forge that means Cloudflare's logs, plus browser history and the Referer of anything clicked from that page.

The suggested fix is right and the mechanism already exists here: setFlash carries the invite link exactly this way, server-side, shown once. The reporter-token path already returns its secret in a response body. Small, self-contained, worth doing before the bigger ones.

2026-09-17 21:34:41

Fixed. A minted secret travels as a nonce, not in the URL.

Landing 50110c55: mintedSecrets.stash puts the secret in a two-minute single-use vault and the redirect carries only the nonce, so the worker token is no longer in the 303 Location — which meant it was in the browser history, in any proxy log, and in the Referer of the next request.

The same mechanism now covers every one-time secret the forge shows once: worker tokens, CI reporter tokens, invite links and password-reset links.

NOTE: b82291eb is the same class for webhooks and is only HALF closed by this. The signing secret is out of the add redirect, but ping and redeliver still answer 500 after delivering, which is a separate defect and stays open.