Issue 285
enhancement: Reset page sends Referrer-Policy as a header, so early requests don't carry the token
Back to our planOpen
enhancementauthpriority: low
Problem
Found while building #283 (PR #284). The reset page clears its token from the address bar on load, but two requests can still carry it to the site's own server before that, which would put the token in server access logs:
- Next puts the page's
no-referrermeta tag after the first stylesheet and script tags in<head>, so those early requests send the full address (token included) as their referer. - The header's sign-in check fires at the same moment the address is cleared, so one request still goes to
/reset-password?token=….
Requests to other sites never get the path under the browser's default policy.
Proposed fix (native first, #262)
- A
Referrer-Policy: no-referrerresponse header for/reset-password, through Next's nativeheaders()innext.config.js(applies before any subresource loads). - Check whether (2) still happens after (1) and #284; if so, delay the header's check until after the address is cleared, or skip it on this page.
Acceptance criteria
- Not done:
/reset-passwordresponds withReferrer-Policy: no-referrer - Not done: No request after the page request carries the token (checked in a browser's network log)
Area
auth
Priority
Low
Generated by Claude Code, opens in a new tab