Summary
NocoDB can treat an OAuth access token as a full user session because both use tokens signed with the instance JWT secret. A person holding a narrowly scoped OAuth token may gain the privileges of the user who granted it if the token is accepted by session-related flows.
Affected context
The vulnerability affects NocoDB deployments where OAuth access tokens can be presented to session-handling components, including the session strategy, short-lived-token exchange, or NocoSocket handshake. Risk depends on a token being accepted outside its intended OAuth scope and treated as a full session for the granting user.
Exploit preconditions
- Attack surface: NocoDB session handling, short-lived-token exchange, or NocoSocket handshake
- Required access: A valid OAuth access token; the token may be narrowly scoped
- Trigger point: The token is submitted to a flow that accepts or exchanges session credentials
- Why exploitation is possible: OAuth tokens and session credentials are signed with the instance JWT secret, and the receiving flow may not sufficiently distinguish their intended type, scope, or privileges
Why this happens
The authentication boundary does not adequately distinguish OAuth access tokens from full session credentials. Because the tokens share a signing secret, a token intended for limited OAuth access may be accepted by session-oriented code without sufficient checks of its purpose or authorization scope. This is an authentication failure mapped to CWE-287: Improper Authentication.
Potential impact
- An OAuth token holder could act with the privileges of the user who granted the token
- An attacker could access or modify data available to that user
- Privileged actions could be performed through affected session or socket flows
- A compromised or exposed OAuth token could have a greater impact than its intended scope
General mitigation guidance
Defensive patterns include separating credential types and ensuring each authentication flow accepts only tokens intended for that purpose. Validate token audience, issuer, type, expiry, and scope, and enforce authorization checks independently of signature validity. Prefer secure-by-default token designs with distinct signing keys or cryptographic context for OAuth and session credentials, reduce exposure and lifetime of sensitive tokens, and apply least privilege to user grants and service access.
How teams detect issues like this
- Review authentication code for shared signing secrets or validation logic across OAuth and session tokens
- Use static analysis and code review to identify flows that accept tokens without checking type, audience, or scope
- Monitor session, token-exchange, and socket authentication events for OAuth credentials used outside their intended flow
- Enforce policies requiring distinct credential purposes and explicit authorization checks
Automated security review tools may help identify token-validation patterns that need closer examination.

