Summary
Parse Server's generic OAuth2 authentication adapter can accept any active token from the provider as valid for any user when the useridField option is not configured.
In this misconfiguration scenario, the server verifies that a token is active but does not confirm that it belongs to the user specified in authData.id, allowing attackers with any valid OAuth2 token from the same provider to impersonate other users.
Affected context
This vulnerability arises in Parse Server deployments that:
- Use the generic OAuth2 authentication adapter (
oauth2: true) - Do not configure the
useridFieldoption - Rely on an OAuth2 provider's token introspection endpoint for token validation
Under these conditions, the server only checks whether a token is active, not whether it was issued for the specific user being logged in, which weakens user identity binding for OAuth2-based logins.
Exploit preconditions
- Attack surface: Parse Server authentication endpoint(s) using OAuth2.
- Required access: Possession of any valid OAuth2 access token from the same identity provider used by the target Parse Server.
- Trigger point: A login or authentication flow where the attacker submits their valid token together with arbitrary
authData.idvalues. - Why exploitation is possible: The OAuth2 adapter, without
useridFieldconfigured, trusts the token's active status from the introspection endpoint but does not verify that the token's subject or user identifier matches the Parse user indicated byauthData.id.
Why this happens
The core issue is an authentication design flaw that fails to bind the validated OAuth2 token to the correct user identity.
In the affected configuration, Parse Server uses the OAuth2 provider's token introspection endpoint only to check whether a token is active, satisfying the "token validity" requirement but omitting a check that the token's subject or user ID corresponds to the application user being authenticated.
This maps to CWE-287: Improper Authentication, where the system incorrectly implements authentication logic so that possession of any valid token is treated as proof of identity for arbitrary users, instead of enforcing a strict association between token claims and the user account.
Potential impact
- Attackers with any valid OAuth2 token from the same provider can log in as other users.
- Full account takeover of arbitrary user accounts, depending on application authorization logic.
- Unauthorized access to sensitive data tied to victim accounts (profiles, application data, API keys).
- Potential privilege escalation if high-privilege or administrative accounts can be impersonated.
- Abuse of victim accounts for actions such as data modification, transactions, or API abuse.
General mitigation guidance
Mitigation focuses on binding tokens to user identities and making authentication decisions based on strongly verified claims:
- Configure the OAuth2 adapter with a
useridField(or equivalent) that explicitly maps a stable user identifier from the token (such assub,user_id, or a provider-specific field) to the Parse user. - Ensure the authentication flow verifies that the identifier in the token's claims matches the user being authenticated, rejecting mismatches.
- Favor a least-privilege approach for tokens: constrain scopes to only what is needed and avoid reusing generic tokens for multiple services without clear subject binding.
- Treat token introspection responses as one part of a broader validation process that also checks user identity, token audience, expiration, and issuer.
- Reduce trust in external identity data by validating expected claims format and enforcing strict schema for identity mapping configurations.
How teams detect issues like this
Organizations can detect this class of vulnerability through:
- Configuration review: Systematically inspecting Parse Server configuration for OAuth2 adapters, flagging any deployment with
oauth2: truethat lacks a defineduseridFieldor equivalent identity mapping. - Code review: Examining authentication middleware and OAuth2 adapter integration to confirm that token validation includes subject/user ID checks, audience checks, and issuer verification rather than relying solely on "active" status.
- Static analysis and policy enforcement: Applying rules or policies that require identity binding fields and claim verification whenever OAuth2 token introspection is used, and alerting on configurations that omit these checks.
- Runtime monitoring: Logging authentication attempts, including token issuer, subject, and mapped user ID, and alerting on suspicious patterns such as one token being used to authenticate different user IDs.

