Summary
Parse Server's Keycloak authentication adapter fails to validate the azp (authorized party) claim in Keycloak access tokens against the configured client ID.
In multi-client Keycloak realms, an attacker can reuse a valid token issued for a different client application to authenticate as arbitrary users on a Parse Server instance, enabling cross-application account takeover.
Affected context
This vulnerability affects Parse Server deployments that:
- Use the Keycloak authentication adapter for user login, and
- Are connected to a Keycloak realm that defines multiple client applications, and
- Accept Keycloak access tokens issued by that realm for authentication.
In such environments, the Parse Server instance does not ensure that the token's azp claim matches the Parse Server's own configured client ID, weakening client-bound token isolation.
Exploit preconditions
- Attack surface: Parse Server endpoints that accept Keycloak-based authentication (e.g., login or API requests authenticated via Keycloak access tokens).
- Required access: Ability to obtain a valid access token from the same Keycloak realm, but for a different client application within that realm.
- Trigger point: Presenting this cross-client access token to the Parse Server Keycloak adapter as proof of authentication.
- Why exploitation is possible: The adapter trusts the token's origin realm but does not verify that the
azpclaim matches the configured client ID, allowing tokens scoped for other clients to be accepted as valid for Parse Server.
Why this happens
The core issue is an incomplete validation of authentication tokens, mapping to CWE-287: Improper Authentication.
The Keycloak adapter checks that the access token is issued by the expected realm but neglects to confirm that the azp (authorized party) claim matches the Parse Server's own client identifier.
Tokens in multi-client identity setups are intended to be bound to specific clients; by ignoring this binding, the adapter treats tokens for any client in the realm as equivalent, breaking the separation between applications and enabling cross-application impersonation.
Potential impact
- An attacker may authenticate to Parse Server using a token issued for a different client application in the same realm.
- An attacker could take over victim accounts on the Parse Server instance, depending on how identity is mapped from the token to user records.
- Cross-application access may occur, where compromise of one client application leads to unauthorized access to Parse Server–backed services.
- Compromised accounts can be used to read, modify, or delete application data exposed via Parse Server.
General mitigation guidance
Effective mitigation focuses on strengthening token validation and reducing implicit trust in identity provider claims:
- Ensure that authentication logic verifies that access tokens'
azp(or equivalent client-identifying claim) matches the Parse Server's configured client ID. - Treat tokens as client-bound: reject tokens where the audience/authorized-party does not correspond to the specific application or API being accessed.
- In multi-client realms, adopt explicit separation between client configurations and avoid reusing credentials or client IDs across services.
- Apply defense-in-depth measures such as role-based access control, least-privilege permissions, and strict mapping rules between identity claims and local user accounts.
- Regularly review identity provider and adapter configurations to ensure that all required claims are validated and that optional checks are not accidentally omitted.
How teams detect issues like this
Detection can rely on both code-centric and operational approaches:
- Static analysis and code review:
- Look for authentication adapters or middleware that validate token signatures and issuers but do not enforce audience/
azpchecks. - Review Keycloak integration points to ensure that client ID matching or audience validation is explicitly implemented.
- Flag any logic that treats all tokens from a realm as interchangeable without client scoping.
- Runtime and log analysis:
- Monitor authentication logs for tokens whose
azpor audience do not correspond to the Parse Server's client ID but are still accepted. - Correlate anomalous login patterns where tokens appear to originate from other client applications in the same realm.
- Policy enforcement:
- Apply organization-wide guidelines requiring audience and authorized-party validation for all OAuth2/OpenID Connect integrations.
- Use automated security review tools or CI checks that highlight missing claim validations in authentication flows.

