Repository navigation
fix(sites): keep console auth cookies out of runtimes and tighten preview access - #14823
Conversation
…view access Site and function runtimes received every request cookie, including the console preview JWT and console session cookies. Preview access also accepted unconfirmed console memberships and expired sessions.
|
Review complete. No issues found — approved ✅. The change tightens preview-domain access control and pins cookie-forwarding behavior for sites runtimes. Verified scans (correctness, security, domain, holistic, sweep) found no issues meeting the reporting threshold.
One reviewer candidate about legacy membership documents missing the Reviewed commit: 40495bc |
🟢 Tier S · Ready to mergeThe router now omits Appwrite console cookies from headers sent to function and site runtimes, while preserving other cookies. Preview authorization also requires a confirmed team membership and an unexpired session bound to the JWT.
📂 Walkthrough · 5
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
fix(sites): keep console auth cookies out of runtimes and tighten preview access (cherry picked from commit ff45743)
What
a_jwt_console(the preview cookie),a_session_consoleanda_session_console_legacyare left out of thecookieheader passed to executions. All other cookies are still forwarded.Request::getHeadersWithoutCookies(array $names)builds the synthesizedcookieheader without the named cookies.getHeaders()now delegates to it.confirm === true). Pending invitations no longer grant access.User::sessionActive()), not just present on the user.Compatibility
Project session cookies (
a_session_<projectId>) are still forwarded. Appwrite's SSR guides tell sites to set and read that cookie themselves, so stripping it would break SSR auth. Only the console cookies, which belong to Appwrite and not to the site, are removed.Tests
tests/unit/Utopia/RequestTest.phpcovers named cookies being left out, and thecookieheader being omitted when no cookies remain.SitesCustomServerTest::testPreviewCookiesdeploys the Astro SSR fixture with a new/cookie-headerpage and checks that only non-console cookies reach the runtime through a preview domain.testPreviewDomainnow also checks that a pending (unconfirmed) console invitee is redirected to preview auth.Related: appwrite-labs/cloud#6673