docs(caddy,runbook): deep links do survive OIDC sign-in, with the evidence #306
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!306
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "docs/oidc-redirect-verified"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Closes #291 — as not a bug. Deep links do survive OIDC sign-in, including through a second-factor
hop. No fix was needed, no upstream report is warranted, and there is no upstream issue to link.
The issue explicitly warned against closing it on header evidence: "the parameter is accepted" and
"the destination is used" are different assertions, and only an actual login distinguishes them. That
caution is honoured — the load-bearing evidence here is completed logins, not response headers.
Evidence
1. The code, at the tag we run (Forgejo 16.0.1).
SignInOAuthsets the cookie(
routers/web/auth/oauth.go:962-965);handleOAuth2SignInreads it back and honours it beforefalling back to
/(oauth.go:1443-1449→RedirectToFirst→context_response.go:53-69)./explore/reposis not rejected as risky (modules/httplib/url.go:22-40). The 2FA branch does notclear the cookie, and both completion paths read it (
auth.go:389-398,webauthn.go:178-184). OAuth2routes are not under
reqSignOut(web.go:856-859), so the query-only short circuit atweb.go:281-285never applies. All three candidate explanations in the issue are therefore false.2. Production. Over seven days of Caddy access logs, the callback's own
Locationheader was/explore/repos×5,/user/webauthn×6,/user/two_factor×2 — and/zero times. One journeyend to end: callback →
303 /user/webauthn→POST /user/webauthn/assertion 200→GET /explore/repos 200.3. What the original report actually caught. The reported walkthrough is in the log one minute
before the issue was filed, and at 20:47:49 the deep link worked. The reporter then deleted their
WebAuthn credential at 20:48:14, which dropped subsequent logins onto TOTP — where
POST /user/two_factorreturned 500. That is the retired-SECRET_KEYAEAD failure alreadyrecorded in the runbook, which notes that removing a passkey is exactly what surfaces it. The login
never completed, so the
/seen in the browser was Forgejo's anonymous landing page (which itselfredirects
/→/explore→/explore/repos), not a post-login destination.So the observation was real and the diagnosis was inverted: this is #292, not a redirect bug.
SameSite=Laxwas ruled out by reasoning rather than testing: the session cookie carries identicalattributes and must reach the callback for PKCE and state to verify, so if
Laxblocked that hop nologin would ever succeed.
What changed
Only comments and documentation.
ansible/roles/caddy/templates/Caddyfile.j2— the comment there had made precisely the inference theissue warns against, marking the behaviour "VERIFIED" on the strength of the cookie being set. Now
states what is actually verified and how.
docs/runbook.md— the finding, the evidence and the #292 connection, so nobody re-investigates thisfrom scratch.
Applying
Nothing to apply. A converge will report
changedon the Caddyfile template and restart Caddy, whichis harmless — worth bundling with the next real apply rather than restarting Caddy for a comment.