Summary
Onyx exposes OAuth Authorization headers belonging to other users through MCP server API responses. An attacker with BASIC_ACCESS may retrieve another user's token when shared MCP configuration data contains per-user credentials.
Affected context
The issue occurs in Onyx deployments where MCP server API endpoints expose authentication metadata derived from shared MCP connection configuration. Per-user OAuth tokens and client information may be copied into an administrator-scoped configuration record, after which the API can return those values to users with BASIC_ACCESS. Exposure depends on the affected MCP configuration flow and the presence of stored OAuth credentials.
Exploit preconditions
- Attack surface: Onyx MCP server API endpoints
- Required access: An authenticated account with BASIC_ACCESS
- Trigger point: Retrieving MCP server data or persona-associated server data
- Required condition: Another user's OAuth token or related client information
must have been copied into a shared MCP connection configuration record
- Why exploitation is possible: Authorization data from a shared record is
returned without adequately enforcing ownership or tenant-level access checks
Why this happens
The underlying flaw combines insecure data scoping with insufficient authorization enforcement. Per-user OAuth values are written into a shared administrator MCPConnectionConfig row, and response serialization exposes the row's authentication headers to callers who are not entitled to view them. This maps primarily to CWE-863, Incorrect Authorization, because access is not properly restricted to the owning user or permitted security context. It also maps to CWE-200, Exposure of Sensitive Information, because OAuth Authorization headers are returned in an API response.
Potential impact
- An attacker may obtain another user's OAuth access token
- A stolen token could allow unauthorized access to connected services
- Attackers could impersonate users within the token's permitted scope
- Sensitive data may be disclosed or modified through downstream integrations
- The incident could enable broader account, tenant, or workflow compromise
General mitigation guidance
Mitigation generally focuses on enforcing strict ownership boundaries for
credentials and preventing sensitive authentication data from entering
shared response objects.
Common defensive patterns include:
- Store OAuth tokens in user- or tenant-scoped secret records rather than shared
administrator configuration rows
- Apply explicit authorization checks before reading or serializing MCP server
configuration
- Return only the minimum non-sensitive fields needed by the client
- Exclude Authorization headers and raw tokens from ordinary API responses
- Use secure secret references or server-side token handles instead of exposing
credential material
- Apply least privilege and narrow scopes to OAuth integrations
- Invalidate or rotate credentials that may have been exposed
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review rules that flag shared persistence of
user-scoped secrets
- Review of API serializers for authentication headers, tokens, and client
secrets
- Authorization tests that compare access across users, tenants, and privilege
levels
- Dynamic testing using separate accounts to verify that one user's MCP
metadata cannot appear in another user's response
- API gateway or policy controls that block sensitive headers and credential
fields from external responses
- Audit logging and alerting for unusual retrieval of MCP configuration data
Automated review tools may help identify direct token exposure, missing
ownership checks, and insecure object-to-response mappings.

