-
Notifications
You must be signed in to change notification settings - Fork 6
Security audit: tenant isolation crossover report #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,19 +91,24 @@ async def _submission_ui_json( | |
| """Build JSON for the session MCP App widget, and store the token for polling.""" | ||
| poll_token = secrets.token_urlsafe(32) | ||
| await redis_store.store_task_token(task_id, token) | ||
| await redis_store.store_poll_token(task_id, poll_token) | ||
|
|
||
| # Record task owner for cross-user access checks (HTTP mode only). | ||
| # This MUST succeed — downstream ownership checks deny access when no | ||
| # owner is recorded, so a silent failure here would lock the user out | ||
| # of their own task. | ||
| user_id = "" | ||
| if settings.is_http: | ||
| access_token = get_access_token() | ||
| if not access_token or not access_token.client_id: | ||
| raise RuntimeError( | ||
| f"Cannot record task owner for {task_id}: no authenticated user" | ||
| ) | ||
|
Comment on lines
100
to
105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: In no-auth HTTP mode, task submission will always fail with a Suggested FixModify Prompt for AI Agent |
||
| await redis_store.store_task_owner(task_id, access_token.client_id) | ||
| user_id = access_token.client_id | ||
| await redis_store.store_task_owner(task_id, user_id) | ||
|
|
||
| # Bind the poll token to the same user identity so the REST layer | ||
| # can cross-check poll_owner == task_owner. | ||
| await redis_store.store_poll_token(task_id, poll_token, user_id=user_id) | ||
| data: dict[str, Any] = { | ||
| "session_url": session_url, | ||
| "task_id": task_id, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.