Consolidate access-token storage to the server-side session - #115
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
Consolidate access-token storage to the server-side session#115devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
The client TokenStore read a plain, JavaScript-readable workos-access-token cookie and adopted its value as the session bearer access token, with no binding to the authenticated session. No server component in this SDK (or in @workos/authkit-session) ever writes this cookie, so it was a dead input channel: an attacker able to write a cookie on the app's registrable domain could plant their own valid token and cause the victim's client-side API calls to authenticate as the attacker. A Path mismatch in the consume-and-delete logic also let a Path=/ plant persist across page loads. Remove the cookie read/consume/delete paths entirely. Tokens are now sourced only from the session-bound server RPCs, which are the only legitimate source. Add a regression test asserting a planted cookie is ignored.
Contributor
Author
Original prompt from Linear User
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
Greptile SummaryThis PR removes the client-readable access-token cookie channel. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "Remove client-readable access-token cook..." | Re-trigger Greptile |
devin-ai-integration
Bot
deleted the
nickcollisson/sec-1348-remove-workos-access-token-cookie-channel
branch
July 27, 2026 16:15
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.
Summary
The client
TokenStore(src/client/tokenStore.ts) read a JavaScript-readableworkos-access-tokencookie and adopted it as the session bearer token. This change removes that client-readable cookie channel and sources the token from the server-side session.Please review before merging.