Summary
Rocket.Chat exposes the /api/v1/oauth-apps.get endpoint to any authenticated user, regardless of their role or specific permissions.
If a user can guess or obtain an OAuth app ID, they may retrieve sensitive details such as client_id and client_secret, which can enable unauthorized OAuth flows and impersonation of trusted integrations.
Affected context
This vulnerability affects Rocket.Chat deployments where:
- OAuth applications are registered and used for integrations or third-party access
- Users can authenticate to the Rocket.Chat instance (including low-privilege or basic users)
- The
GET /api/v1/oauth-apps.getendpoint is reachable and not protected by fine-grained authorization checks
The issue arises when any authenticated user can query OAuth application records by ID and receive sensitive configuration fields.
Exploit preconditions
- Attack surface: Authenticated Rocket.Chat HTTP API (
/api/v1/oauth-apps.get) - Required access: Any valid user account (no special role or admin rights required)
- Knowledge required: An existing OAuth application ID (obtainable via guesswork, enumeration, logs, code, or social engineering)
- Trigger point: Issuing a GET request to
/api/v1/oauth-apps.getwith a known OAuth app ID - Why exploitation is possible: The endpoint enforces authentication but does not enforce proper authorization or role-based access control checks for reading OAuth application secrets.
Why this happens
The core issue is a broken access control pattern where an authenticated-only check is treated as sufficient for accessing highly sensitive configuration data.
Instead of verifying that the caller has administrative or owner-level permissions for a given OAuth application, the API endpoint returns full records based solely on knowledge of the application ID.
This maps primarily to CWE-862: Missing Authorization, with a related element of CWE-269: Improper Privilege Management, because sensitive secrets are exposed without appropriate privilege boundaries or least-privilege enforcement.
Potential impact
- An attacker with a low-privilege account can obtain
client_idandclient_secretfor internal or third-party OAuth apps. - Unauthorized initiation or completion of OAuth flows, potentially impersonating legitimate services or users.
- Abuse of trusted integrations to access additional data or perform actions in connected systems.
- Facilitation of phishing or session hijacking attacks by leveraging compromised OAuth credentials.
- Expansion of an initial foothold into broader system or ecosystem compromise via connected applications.
General mitigation guidance
Effective mitigation focuses on enforcing strict, role-aware access controls around sensitive configuration endpoints:
- Restrict access to OAuth application details to clearly defined privileged roles (e.g., system administrators, app owners).
- Separate public and private fields in OAuth application models, returning only non-sensitive metadata to general users, if needed at all.
- Apply least-privilege principles so that default or low-privilege roles cannot read configuration secrets.
- Centralize authorization decisions using a consistent RBAC or policy engine to avoid per-endpoint ad hoc checks.
- Consider auditing and minimizing where OAuth client secrets are stored and exposed; use secret storage mechanisms and rotate secrets when exposure may have occurred.
How teams detect issues like this
Organizations can identify and monitor this class of weakness using:
- Static analysis and code review: Look for API endpoints that return sensitive configuration objects (e.g., OAuth apps) with only a generic "authenticated user" check and no role/ownership validation.
- Access control reviews: Periodically review route definitions and middleware to ensure sensitive endpoints are gated by appropriate authorization layers, not just authentication.
- Logging and monitoring: Enable detailed logging on OAuth-related endpoints; alert on unusual access patterns, such as non-admin users frequently querying OAuth configuration.
- Security testing: Incorporate authorization tests in API security scans and manual penetration tests, attempting to access admin-level endpoints with low-privilege accounts.

