Repository navigation
Conversation
The session cookie value was the signed raw JSON payload, so it held quotes and commas. Reverse proxies that re-parse the Cookie header with Go's net/http (e.g. NetBird's reverse proxy, netbirdio/netbird#7298) drop such values, which logged users out right after sign-in. issue_session now signs base64url(JSON) without padding; optional_user decodes it and still accepts existing raw-JSON cookies and the legacy b"authed" cookie, so nobody is logged out by the update. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The session cookie value is the signed raw JSON payload, so it contains quotes and commas. Reverse proxies that re-parse the
Cookieheader with Go'snet/httpdrop such values (e.g. NetBird's reverse proxy, netbirdio/netbird#7298), which logs users out right after sign-in.Change:
issue_sessionnow signsbase64url(JSON)without padding;optional_userdecodes it and still accepts existing raw-JSON cookies and the legacyb"authed"cookie, so nobody is logged out by the update.Testing: new test
test_issued_cookie_is_proxy_safe_and_resolves(cookie value has no",,or\, and resolves to the user); full suite 374 passed;ruff check app/ tests/ scripts/clean. Running behind NetBird's proxy in production since 2026-11-28.ruff format --checkreports both touched files, but they were already unformatted upstream; I left formatting alone to keep the diff to the fix.🤖 Generated with Claude Code