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
fix(proxy): keep the fallback session header out of function and site requests - #14925
#14874 stopped forwarding Appwrite session cookies to function and site runtimes. But clients that can't use cookies send the same session in x-fallback-cookies, and that header still reached user code.
$requestHeaders = \array_map(..., $request->getHeadersWithoutCookies($strippedCookies));
+ // Clients without cookie support send their session in this header instead.+ unset($requestHeaders['x-fallback-cookies']);
Test
SitesCustomServerTest::testPreviewCookies now also sends x-fallback-cookies, and asserts the site never sees it. The astro fixture's /cookie-header echoes that header back.
Found while backporting #14874 to 1.9.x, where #14911 ships the same fix.
This change prevents session-bearing fallback-cookie headers from being forwarded to proxied backends, closing a session-credential leak path, and covers it with an end-to-end test backed by a new Astro fixture page that echoes received cookie headers.
Files
Change
app/controllers/general.php
Adds header sanitization so X-Fallback-Cookies is removed before proxying requests for site previews and function executions.
The filtering runs on the normalized header map used by both function and site proxy requests, and the E2E test covers the site behavior.
The function/site proxy now removes x-fallback-cookies from headers forwarded to runtimes. The Astro fixture and site E2E test verify the fallback session header is absent from runtime requests while ordinary cookies continue to be forwarded.
Verdict
New comments
Fixed
Still open
✅ Approved
0
0
0
📂 Walkthrough · 3
File
Change
app/controllers/general.php
Removes the fallback session header from the proxy request headers before forwarding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#14874 stopped forwarding Appwrite session cookies to function and site runtimes. But clients that can't use cookies send the same session in
x-fallback-cookies, and that header still reached user code.Test
SitesCustomServerTest::testPreviewCookiesnow also sendsx-fallback-cookies, and asserts the site never sees it. The astro fixture's/cookie-headerechoes that header back.Found while backporting #14874 to 1.9.x, where #14911 ships the same fix.