Summary
OpenReplay's Python API exposes app_apikey routes that accept a caller-supplied projectKey and only validate that the API key is valid and the target project exists, without ensuring they belong to the same tenant.
Since projectKey values are exposed to browser-side code, an attacker with any valid API key for their own tenant can use a victim tenant's projectKey to enumerate and read sensitive session data across tenant boundaries.
Affected context
This vulnerability affects OpenReplay deployments where:
- The Python API is used to access session replay data via app_apikey routes.
- Project identifiers (projectKey) are embedded in or exposed to browser-side tracker code.
- Authorization logic validates API key authenticity and project existence, but does not bind the API key to the same tenant as the target project.
In such environments, any party that legitimately holds an API key for one tenant may still be able to query projects owned by another tenant if they know or can observe that tenant's projectKey.
Exploit preconditions
- Attack surface: HTTP(S) endpoints of the OpenReplay Python API that use app_apikey routes.
- Required access: Possession of any valid API key for a tenant in the OpenReplay instance (e.g., an attacker's own tenant).
- Knowledge required: Knowledge of a victim project's projectKey, typically obtainable from public tracker code embedded in the victim's website or application.
- Trigger point: Making API requests to affected app_apikey routes while specifying the victim projectKey instead of the attacker's own projectKey.
- Why exploitation is possible: The authorization flow validates the API key and ensures the target project exists, but does not verify that the authenticated API key and the projectKey belong to the same tenant, allowing cross-tenant queries.
Why this happens
The underlying issue is a broken authorization pattern where access control is performed at the resource level without enforcing tenant isolation.
The API:
- Treats a caller-supplied projectKey as an authoritative selector for which project's data to access.
- Checks only that the API key is valid and that the specified project exists.
- Fails to verify that the project is owned by the same tenant as the principal represented by the API key.
This maps to CWE-284: Improper Access Control, specifically in a multi-tenant context where tenancy boundaries must be enforced but the code does not establish a proper relationship between authentication (who you are) and authorization (which tenant's resources you may access).
Potential impact
- Cross-tenant enumeration of session identifiers and user sessions.
- Unauthorized access to sensitive session replay data, including user interactions and potentially personal or confidential information.
- Violation of privacy expectations and possible non-compliance with data protection regulations.
- Increased risk of targeted attacks (e.g., account takeover attempts) informed by observed victim user behavior.
- Erosion of trust in the platform's multi-tenant isolation guarantees.
General mitigation guidance
Effective mitigation focuses on enforcing strict tenant binding between credentials and resources:
- Ensure that every access control decision involving projectKey also validates that the project is owned by the same tenant as the authenticated principal (API key, token, or user).
- Design APIs so that tenant and project context are derived from the authenticated principal on the server side, rather than trusting client-supplied identifiers.
- Apply a consistent authorization layer or middleware that centralizes tenant and project ownership checks, instead of duplicating logic in individual routes.
- Avoid exposing direct cross-tenant selectors in public client-side code when possible, or treat them as untrusted and always re-validate permissions server-side.
- Follow least-privilege principles by scoping API keys or tokens to specific tenants and projects, reducing the blast radius if keys are misused.
How teams detect issues like this
Organizations can detect and monitor similar authorization flaws by:
- Reviewing access control logic for multi-tenant services to confirm that every resource query includes a tenant ownership check linking the authenticated principal to the requested resource.
- Using static analysis or security linters configured to flag handlers where resource identifiers from the request (e.g., projectKey, tenantId) are used directly in queries without joining or validating against the authenticated user's tenant context.
- Implementing code review checklists that explicitly call out tenant isolation requirements, requiring reviewers to verify that routes cannot access resources outside the caller's tenant.
- Analyzing API access logs for patterns where a single API key accesses multiple distinct tenants' projects or unusually broad sets of projectKeys.
- Employing automated security testing or fuzzing that attempts cross-tenant access by reusing known identifiers from one tenant while authenticated as another.

