You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e637272
Browse filesBrowse the repository at this point in the historyBrowse files
fix: http(s) scheme floor for redirect navigation targets (#3175)
maskRedirect resolves Location with new URL(target, requestUrl), where
an absolute scheme wins over the base — throw redirect(next) with user
data emitted "302 javascript:alert(document.cookie)" as the header's
documented "resolved absolute target". Same-origin script execution in
any integration that navigates to the decoded value.
- The transport (enforceComposedHeaderInvariants, the widened #3158
hook) refuses non-http(s) targets on REDIRECT_HEADER and Location
with a sanitized 500. Relative and cross-origin http(s) targets flow:
the floor kills the script-execution class; same-origin-vs-allowlist
is the separate policy ruling still pending.
- decodeRedirectHeaderValue enforces the resolved-absolute-http(s)
contract it documents (and the masked status set), so a hostile peer
cannot re-open the class against location.href integrations.
Co-authored-by: Cursor <[email protected]>
Navigation targets now carry an http(s) scheme floor on both legs of the redirect header (#3175). `maskRedirect` resolves targets with `new URL(target, requestUrl)` where an absolute scheme wins over the base, so `throw redirect(next)` with user data emitted `javascript:alert(document.cookie)` as the header's "resolved absolute target" — same-origin script execution in any integration that navigates to the decoded value. The transport now refuses non-http(s) schemes on `X-Server-Function-Redirect` and `Location` with a sanitized 500 (relative targets and cross-origin http(s) still flow — the same-origin-vs-allowlist policy is a separate, pending decision), and `decodeRedirectHeaderValue` enforces the resolved-absolute-http(s) contract it documents, so a hostile peer cannot re-open the class against `location.href = decoded.url` integrations.
0 commit comments