Onyx AI
Hardcoded Default Value for SUPER_CLOUD_API_KEY Exposes Impersonation Endpoint in Multi-Tenant Enterprise Deployments
A traditional scanner pointed at this codebase would have flagged a hardcoded string and filed a medium-confidence finding. Kira did something different: it traced the credential forward through the auth stack, identified what endpoint it protected, mapped what that endpoint could do, and reasoned through the full blast radius: cross-tenant session token issuance, silent access to every connected data source, and no audit trail. The hardcoded default was the entry point. What Kira surfaced was the impact.
SUPER_CLOUD_API_KEY, the credential protecting the /tenants/impersonate endpoint in Onyx Enterprise Edition, defaulted to the literal string "api_key" when the environment variable was not set. This value is publicly visible in the open-source repository. Any MULTI_TENANT deployment where SUPER_CLOUD_API_KEY was not explicitly configured was operating with a trivially known credential on a privileged platform endpoint.
The default value was hardcoded verbatim in the configuration module:
The current_cloud_superuser dependency in backend/ee/onyx/auth/users.py (pre-patch lines 40–53) validated the caller’s Authorization header against this value using a plain string comparison:
On any deployment where SUPER_CLOUD_API_KEY was not set in the environment, the effective credential was the well-known string "api_key", present verbatim in the public source code and requiring no brute force to discover. The comparison also used != rather than a constant-time function, introducing a timing side channel.
Kira did not stop at flagging the hardcoded string. It traced the credential forward through the codebase: SUPER_CLOUD_API_KEY flows into current_cloud_superuser in auth/users.py, which is the dependency guarding POST /tenants/impersonate in server/tenants/api.py. Kira then read what that endpoint actually does: it resolves the target user across all tenants and returns a live session token. From there it mapped the downstream scope: that token authenticates against every connected data source the victim has authorised, including Google Drive, Confluence, Slack, GitHub, Jira, and Notion.
The reasoning chain Kira followed:
Step 1: Credential discovery · SUPER_CLOUD_API_KEY defaults to "api_key" in app_configs.py. Value is public. Any deployment without explicit env var is using a known credential.
Step 2: Auth flow trace · The credential is the only secret protecting current_cloud_superuser. The second check, the SUPER_USERS email allowlist, is set by the platform operator and cannot be modified by a tenant admin.
Step 3: Endpoint capability · /tenants/impersonate performs a global user lookup across all tenants and returns a valid session token for any target email, with no scope restriction.
Step 4: Blast radius · The returned token is a full session credential. Kira traced it through the integration layer to enumerate what it unlocks: every data source the victim has connected. The victim has no visibility that impersonation occurred. No audit event existed (pre-patch).
That session token carries the victim’s full Onyx workspace: every document, every connector, and every integration authorised under their account. Google Drive, Confluence, Slack, GitHub, Jira, and Notion are all silently readable. No notification to the victim. No entry in logs (pre-patch).
Fix commit fb912b6c ↗, June 24 2026
Three changes in a single commit:
Feature flag commit 2878d850 ↗, June 23 2026
Adds an IMPERSONATION_ENABLED feature flag (default off). When disabled, the route is not registered at all, so requests return 404 before reaching the authentication layer.
This vulnerability only affects deployments running in MULTI_TENANT mode, which is the Onyx Enterprise Edition cloud configuration. Single-tenant self-hosted deployments do not mount the /tenants/impersonate route and are not affected.
All Onyx Enterprise Edition versions before commit fb912b6c (June 24 2026) where SUPER_CLOUD_API_KEY was not explicitly set in the deployment environment are affected.
Any MULTI_TENANT deployment where SUPER_CLOUD_API_KEY was not explicitly set should be treated as potentially compromised:
1. Upgrade · Apply the patched version containing commit fb912b6c.
2. Rotate the key · Set SUPER_CLOUD_API_KEY to a strong random secret in your deployment environment. Do not rely on any default.
3. Invalidate sessions · Rotate all active user sessions in case the endpoint was used to issue tokens.
4. Review logs · Check access logs for unexpected calls to POST /tenants/impersonate before your upgrade date.
5. Notify administrators · Consider notifying affected tenant administrators per your incident response policy.
Onyx AI thanked Offgrid Security for the report and shipped fixes promptly across two commits. The CWE-798 finding (hardcoded default credential) was acknowledged as a valid catch and fully remediated: the "api_key" default is removed, the check now fails closed with HTTP 401 when the key is unconfigured, and the comparison uses secrets.compare_digest eliminating the timing side channel. No formal security advisory was published.
CWE-798 fixed in fb912b6c ↗. No advisory published because Onyx considers MULTI_TENANT mode outside documented deployment scope. Reported by Kira, Offgrid Security.