Security assessment report · Sample
SuperTokens Core: multitenancy authorization review
Prepared by Judel Palaca (pal0x) · Status: fixed upstream · Published Nov 2026
1. Summary
The review covered the multitenancy management API of SuperTokens Core, self-hosted. The goal was to confirm that one application in a multi-app deployment cannot read or change another application's configuration, users, or keys.
One critical issue was found. An attacker with a valid API key for any single application could update the shared parent domain configuration, replace sibling applications' API keys, and then act as users of those applications. The vendor fixed the issue across all supported release branches.
| Findings | 1 critical |
|---|---|
| Overall risk | High for licensed multi-app deployments that share one connection URI domain |
| Remediation status | Fixed upstream (see section 5) |
2. Scope and method
| Target | SuperTokens Core (supertokens-core), self-hosted test deployment |
|---|---|
| Focus | Tenant and application isolation in the multitenancy create/update API |
| Approach | Source review of the permission checks, then manual testing against a local deployment with two sibling applications, each with its own API key |
| Out of scope | Hosted SuperTokens infrastructure and any third-party deployments |
3. Finding
F-01 · Cross-application API key takeover via multitenancy update CRITICAL · CVSS 3.1 9.9
| Component | Multitenancy.checkPermissionsForCreateOrUpdate in src/main/java/io/supertokens/multitenancy/Multitenancy.java |
|---|---|
| Weakness | CWE-639 Authorization bypass through user-controlled key · CWE-863 Incorrect authorization |
| Preconditions | Licensed multi-tenant deployment with several apps under one non-default connection URI domain. Attacker holds the API key of any one of those apps. |
| Vector | AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H |
What is wrong. When a request targets the parent connection URI domain, the permission check confirms the domain but does not require the calling application and tenant to be the public (owner) ones. Any sibling app key therefore passes. A second path exists: if the optional identifier is omitted, the request targets the base tenant and skips both the permission branches and the enterprise feature gate.
How it is exploited.
- Use app A's own key to send a v2 multitenancy update aimed at the shared parent domain.
- Replace the parent's API key. The
api_keysfield is not protected on this path. - With the new parent key, replace app B's API key.
- Use app B's new key to read or change app B's users and create sessions as them.
[ Request and response evidence for each step was given to the vendor privately and is left out of this sample. ]
Impact.
- Full takeover of sibling applications that share the domain: user data read and write, and sessions as any user.
- Persistence through a sibling dashboard user, and lockout of the real owner from their own key.
- Base-tenant variant: the attacker can change first factors, required second factors, and which recipes are enabled. That weakens login integrity and can block sign-in. This variant cannot steal keys.
4. Recommendations
- For any create or update that targets a connection URI domain or the base tenant, require the calling app and tenant to be the public ones.
- Treat a missing identifier as an error instead of silently targeting the base tenant. Apply the enterprise feature gate on every path.
- Refuse
api_keyschanges from any caller other than the owning scope. - Add regression tests in which a sibling app key tries each of these operations and must fail.
5. Remediation and retest
The vendor shipped fixes on every supported branch, including 10.0.8, 10.1.9, 11.0.9, 11.1.4, 11.2.4, 11.3.8, 11.4.8, 12.0.11, 12.1.2, 12.2.1 and 12.3.1. Upgrade to the fixed release for your branch. In a client engagement, I retest every fixed finding and record the result here.