Summary
Parse Server contains an improper authorization vulnerability in its query handling logic around the redirectClassNameForKey parameter that can expose other users' session tokens.
Under certain class-level permission configurations, an attacker who can create or update objects with new relation fields may exfiltrate session tokens and use them to take over victim accounts, even without prior authentication.
Affected context
The vulnerability appears in Parse Server deployments where:
- The
redirectClassNameForKeyquery parameter is supported and enabled in the API surface. - Class-Level Permissions (CLPs) allow at least one class to be used by attackers to create or update objects with new relation fields.
- Session tokens are stored and trusted for user authentication across API calls.
In such environments, misaligned or insufficient authorization checks around query redirection paths can cause session tokens belonging to other users to be returned in responses to attacker-controlled queries.
Exploit preconditions
- Attack surface: Public or internal Parse Server API endpoints that accept queries using
redirectClassNameForKey. - Required access:
- May be unauthenticated, if CLPs allow object creation or updates by anonymous users.
- Otherwise, requires a low-privileged authenticated account that can create or update objects in at least one class.
- Capability prerequisite: Ability to create or update an object with a new relation field that can be leveraged in queries involving
redirectClassNameForKey. - Trigger point: Sending crafted queries that use
redirectClassNameForKeyso that the server follows an unintended data path and returns session-related data. - Why exploitation is possible: Authorization checks for redirected queries do not correctly enforce ownership and CLPs on the data ultimately returned, allowing session token attributes from other users to leak to the attacker.
Why this happens
This issue stems from improper authorization (CWE-863) in the query processing chain, specifically when handling query redirection via the redirectClassNameForKey parameter.
The server allows a query to be redirected from one class to another based on the value of a relation field, but the authorization logic does not consistently re-validate access rights on the target class and fields from which session tokens can be derived.
As a result, a user who controls the structure of certain objects (especially new relation fields) can influence how queries are resolved and cause the server to expose session token data that should be protected by stronger access control.
Conceptually, this reflects an access control boundary being applied to the initial query source but not strictly re-applied to the redirected destination, causing a privilege escalation in read access to sensitive authentication state.
Potential impact
- Exfiltration of valid session tokens belonging to other users.
- Full account takeover for affected users by replaying stolen session tokens.
- Impersonation of users in API calls, including potential access to their data and actions.
- Escalation from unauthenticated or low-privileged access to higher-privileged user contexts.
- Possible pivot to administrative or highly privileged user accounts if their session tokens are exposed.
General mitigation guidance
Effective mitigation focuses on tightening authorization checks and minimizing indirect data exposure paths:
- Ensure that any query redirection mechanism (such as
redirectClassNameForKey) performs complete permission checks on the final target class and fields, not just the source class. - Treat session tokens and authentication data as highly sensitive fields, enforcing strict per-user access control and avoiding their inclusion in generic query responses.
- Harden Class-Level Permissions so that untrusted or anonymous users cannot arbitrarily create or update objects with new relation fields that influence cross-class queries.
- Apply the principle of least privilege to both data access and metadata structures (relations, pointers, and polymorphic references).
- Use defense-in-depth by adding server-side logic that whitelists which fields and classes may be traversed or returned through redirection features.
- Consider segregating authentication/session data into dedicated storage or classes that are never exposed through generic query mechanisms.
How teams detect issues like this
Organizations can look for this class of issues through both code-centric and runtime-focused approaches:
- Static analysis and code review:
- Flag query routing or redirection features (like
redirectClassNameForKey) that do not clearly re-check authorization on the final class. - Examine handlers that access session tokens or authentication state to ensure they are never returned via general-purpose query endpoints.
- Verify that access control logic is consistently applied after any dynamic resolution of class names, references, or relations.
- Policy and architectural checks:
- Enforce policies that sensitive authentication fields are excluded from generic query projections and not traversable via relations.
- Periodically review Class-Level Permissions to identify classes that allow overly permissive create or update operations for anonymous or low-privileged users.
- Runtime monitoring:
- Log and monitor requests using
redirectClassNameForKeyor similar redirection parameters, looking for unusual patterns from untrusted sources. - Alert on responses that contain session-like tokens or authentication artifacts in contexts where they should not be present.
- Automated code scanning tools and API security testing frameworks can augment these efforts by identifying unsafe authorization flows around query redirection and sensitive fields.

