Skip to content

SEC: Broken Access Control — user-level horizontal privilege escalation #174

Closed

Description

@vybe

Pentest Finding 3.1.3 — High (CVSS 8.5)

CVSS Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected Endpoints (80+ endpoints across multiple routers)

Operational Data (admin-only data accessible by any user)

  • GET /api/ops/auth-report, /api/ops/costs, /api/ops/fleet/status, /api/ops/fleet/health
  • GET /api/ops/schedules, /api/ops/alerts
  • POST /api/ops/alerts/{id}/acknowledge
  • GET /api/observability/metrics, /api/observability/status
  • GET /api/credentials/encryption-key ← master encryption key exposed
  • GET /api/system-agent/status

Cross-Tenant Agent Operations (any user can act on any agent)

  • DELETE /api/agents/{name}/chat/history — wipe chat histories
  • PUT /api/agents/{name}/mode — alter agent AI models
  • POST /api/agents/{name}/queue/clear — disrupt task queues
  • POST /api/agents/{name}/credentials/inject — inject credentials
  • POST /api/agents/{name}/credentials/export — export credentials
  • PUT /api/agents/{name}/skills — modify agent skills
  • POST /api/agents/{name}/chat — chat with other users' agents
  • POST /api/agents/{name}/task — submit tasks to other users' agents

Cross-Tenant Process/Execution Operations

  • GET /api/processes — see all processes (not just own)
  • POST /api/processes/{id}/archive — archive others' processes
  • GET /api/executions — see all executions
  • POST /api/executions/{id}/cancel — cancel others' executions
  • POST /api/executions/{id}/retry — retry others' executions
  • GET /api/notifications — see all notifications
  • PUT /api/alerts/thresholds/{id} — modify others' alert thresholds

(Full list of 80+ endpoints in pentest report section 3.1.3)

Impact

Authenticated users can view, modify, and destructively interact with agents and operational data not belonging to them. This horizontal privilege escalation breaks user isolation. Critically:

  • Low-privileged users can extract the platform's master encryption key via GET /api/credentials/encryption-key
  • Users can wipe chat histories, alter AI models, and disrupt task queues of agents they don't own
  • Complete compromise of encrypted secrets across the entire application

Steps to Reproduce

# As non-owner user, get auth report for ALL agents
GET /api/ops/auth-report
Authorization: Bearer {USER_TOKEN}
# Returns data for all agents including ones user cannot access

# As non-owner user, delete another user's chat history
DELETE /api/agents/hello/chat/history
Authorization: Bearer {NON_OWNER_USER_TOKEN}
# Returns 200 OK — history deleted

Remediation

  • Apply server-side access control for all queries — do not rely only on UI restrictions
  • Implement ownership checks (not just can_user_access_agent) on all mutation endpoints
  • Restrict ops/observability/credentials endpoints to admin-only access
  • Use a single application-wide mechanism for enforcing access controls
  • Make it mandatory for developers to declare allowed access for each resource, deny by default
  • Thoroughly audit and test access controls

References

Source: UnderDefense Web Pentest Report, March 2026

Activity

  1. added
    priority-p0
    security
    pentest
    severity-high
    on Mar 26, 2026
  2. vybe commented on Mar 26, 2026

    @vybe
    ContributorAuthor

    Implementation Complete

    Hardened 39 endpoints across 11 routers to enforce proper server-side access control.

    Changes by Category

    Admin-only enforcement (22 endpoints):

    • ops.py — fleet/status, fleet/health, schedules, costs, auth-report, alerts, alert acknowledge
    • observability.py — metrics, status
    • system_agent.py — status
    • alerts.py — threshold set, threshold delete

    Owner-only enforcement (10 endpoints):

    • credentials.py — inject, export, import (upgraded from AuthorizedAgent → OwnedAgent)
    • chat.py — DELETE chat history
    • agents.py — queue/clear, queue/release
    • skills.py — PUT skills, assign, unassign, inject

    Access checks added (7 endpoints):

    • agents.py — stats, queue GET (added AuthorizedAgentByName)
    • skills.py — GET skills (added AuthorizedAgentByName)
    • notifications.py — list filtered by accessible agents; get/acknowledge/dismiss check can_user_access_agent
    • processes.py — archive, new-version (added RBAC via ProcessAuthorizationService)
    • executions.py — events, step output, costs, analytics (added can_view_execution)

    Test Coverage

    • 30 new tests in test_access_control.py — creates a non-admin user, verifies 403 on all hardened endpoints
    • Full test suite: 1,436 passed, 0 regressions from this change

    Validation

    • GET /api/credentials/encryption-key was already admin-only (confirmed)
    • PUT /api/agents/{name}/mode does not exist (confirmed — issue reference outdated)

    Not in scope (separate concerns)

    • Process/execution ownership model (processes don't have per-user ownership yet — they use role-based RBAC)
    • GET /api/agents/slots returns all agent slots (intentional for dashboard polling)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pentestpriority-p0securityseverity-high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions