fix(dashboard): restrict tasks/queue leak and gate config to admin - #13
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(dashboard): restrict tasks/queue leak and gate config to admin#13cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
PR #4 locked down ps/sessions/inspect/kill but left kernel_exec tasks and queue returning global AgentTask instructions and inflight session IDs to any logged-in user. kernel_snapshot queue was also unfiltered. Config read/write/backup endpoints only required authentication, letting non-admin users read API keys and overwrite daemon config. Add per-user filters for tasks and queue, apply queue filter in snapshot, and require admin (or bearer token) when dashboard auth is enabled. Co-authored-by: Yuxuan Liu <Osc-7@users.noreply.github.com>
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.
Bug and impact
Multi-user dashboard deployments had two incomplete auth fixes after PR #4:
kernel_exec tasks/queue— Non-admin users could read other users' AgentTask instructions (up to 240 chars) and global inflight/cancelled session IDs.kernel_snapshotalso returned unfiltered queue data./api/config/*— Any authenticated user could read fullconfig.yaml(API keys, tokens) and overwrite daemon configuration.Root cause
Session isolation was applied to
ps,sessions,inspect, andkillverbs but nottasks/queue. Config endpoints only required authentication, not admin role.Fix
_filter_agent_tasks_for_userand_filter_queue_for_user; apply inkernel_execandkernel_snapshot._require_dashboard_admingate on all config read/write/backup routes when dashboard auth is enabled (admin user or bearer token).Validation
uv run pytest tests/test_dashboard_auth.py -v— 15 passed