Conversation
The Ask AI assistant scoped its (per-org, per-user) Redis storage by the session's ambient activeOrganizationId. The chat lives in the persistent app shell while the client tracks the URL org, so for multi-org users the two could diverge — letting one org's chat be read or written under another org's key (cross-tenant history exposure). Scope every chat op by an explicit, membership-verified org instead: - Add resolveAssistantChatContext: reads X-Organization-Id; when it differs from the session active org, re-verifies active membership + app:read before scoping (else 403); falls back to the active org when absent (backward compatible). - Route completions + GET/PUT/DELETE history through it; add Cache-Control: no-store to GET history; log when orgs diverge. - chat.tsx sends the org on every call — the flush PUT keys by the snapshot's own org (the contamination fix) and completions uses a ref-based header so the AI's tools scope to the viewed org. - Add 8 unit tests for the resolver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s-tenant fix(assistant-chat): scope chat to membership-verified org (cross-tenant history leak)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
|
🎉 This PR is included in version 3.78.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Scope Assistant Chat to a membership-verified organization to prevent cross-tenant history mix-ups and ensure tools run in the org the user is viewing. Adds a server resolver and updates the client to send
X-Organization-Idon every call.resolveAssistantChatContextto readX-Organization-Id; when it differs from the session org, re-verify active membership andapp:read, else 403; falls back to the session org when absent.Cache-Control: no-storeon GET history to prevent caching.X-Organization-Idper request; history saves/flushes are keyed by the snapshot’s own org to avoid cross-tenant writes.Written for commit 29bdd6e. Summary will update on new commits.