CVE-2026-123800 CRITICAL 9.9 난이도Difficulty 중급Intermediate

SuperTokens Core에서 앱 범위 API 키가 상위 connection URI domain의 설정을 덮어써 형제 앱을 탈취하는 취약점App-scoped API key rewrites its parent connection URI domain's config and takes over sibling apps in SuperTokens Core

공식 참조Official references: NVDCVE.org

CVE-2026-123800는 SuperTokens Core의 Authorization Bypass Through User-Controlled Key(CWE-639) 취약점으로, CVSS 9.9(CRITICAL)입니다. 영향 버전: 6.0.0 ≤ v < 각 릴리스 라인의 수정 버전. 수정 버전: 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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, 12.3.1.CVE-2026-123800 is an Authorization Bypass Through User-Controlled Key (CWE-639) vulnerability in SuperTokens Core, rated CVSS 9.9 (CRITICAL). Affected: 6.0.0 ≤ v < the fixed release of each line. Fixed in: 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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, 12.3.1.

제품Product SuperTokens Core
영향 버전Affected 6.0.0 ≤ v < 각 릴리스 라인의 수정 버전6.0.0 ≤ v < the fixed release of each line
수정 버전Fixed in 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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, 12.3.1
심각도Severity CVSS 9.9 CRITICAL
취약점 유형Weakness CWE-639 Authorization Bypass Through User-Controlled Key
공격 조건Attack conditions 원격 (네트워크) · 일반 권한 계정 필요 · 사용자 상호작용 불필요Remote (network) · Low-privilege account · No user interaction

1. TL;DR

SuperTokens Core는 오픈소스 인증 서버다. 멀티 테넌트 구성에서는 하나의 “connection URI domain”(CUD) 아래에 여러 애플리케이션을 호스팅할 수 있다. 영향받는 버전에서는 CUD를 생성하거나 업데이트할 때의 권한 검사가 CUD 이름만 비교했다. 호출자가 해당 CUD의 최상위(public app, public tenant) 신원인지는 확인하지 않았다.

그 결과 하나의 애플리케이션으로 범위가 제한된 API 키가 상위 도메인 자체의 신원으로 통과할 수 있었다. 호출자는 api_keys를 포함한 도메인 설정을 다시 쓸 수 있었다. NVD 설명에 따르면 공격자는 이를 통해 형제 애플리케이션의 키도 교체할 수 있다. 이어서 형제 앱의 사용자를 읽거나 변경하고, 그 사용자로서 세션을 얻고, 실제 소유자를 잠가 버릴 수 있다.

두 번째 변형은 요청에서 테넌트 식별자를 생략하면 base tenant에 도달하는 경우다. 이 변형으로는 로그인 팩터와 recipe 설정은 바꿀 수 있지만 core config나 키는 바꿀 수 없다. 수정(CVSS 9.9)은 두 검사를 모두 강화한다. CVE 레코드에 나열된 18개 패치 릴리스 라인 모두에서 사용할 수 있다.

2. Flaw 분류

항목값
주요 CWECWE-639 Authorization Bypass Through User-Controlled Key. NVD는 CWE-863 Incorrect Authorization도 함께 표기한다.
취약 위치src/main/java/io/supertokens/multitenancy/Multitenancy.java의 Multitenancy.checkPermissionsForCreateOrUpdate
공격 벡터네트워크 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H, 점수 9.9)
영향NVD 기준: 형제 애플리케이션의 사용자 읽기·수정, 해당 사용자로서 세션 획득, 형제 대시보드 사용자를 통한 지속성 확보, API 키 교체 및 정당한 소유자 차단. base 대상 변형은 firstFactors, 필수 보조 팩터, recipe 활성화 플래그를 변경할 수 있어 로그인 무결성과 가용성에 영향을 준다.
선행 조건라이선스가 적용된 멀티 테넌트 배포. 기본값이 아닌 하나의 CUD 아래에 여러 애플리케이션이 있고 각각 고유한 api_keys를 가져야 한다. 공격자는 애플리케이션 하나의 유효한 API 키가 필요하다(낮은 권한, 사용자 상호작용 없음).
범위 변경있음 (S:C). 한 앱의 자격 증명이 다른 앱에 영향을 준다.

3. 근본 원인

배경

SuperTokens는 요청의 “출처”를 CUD, 앱 ID, 테넌트 ID의 튜플로 식별한다. 테넌트, 앱, CUD를 생성하거나 업데이트하는 작업은 checkPermissionsForCreateOrUpdate를 거친다. 이 함수는 호출자의 튜플(source)을 변경 대상 객체(target)와 비교한다.

버그

패치 주석은 의도된 규칙을 설명한다. CUD를 생성하거나 업데이트하려면 호출자가 base tenant이거나, 같은 CUD의 public app 및 public tenant여야 한다.

취약한 분기는 두 가지만 검사했다.

  • source가 base tenant인지,
  • source의 CUD 문자열이 target의 CUD 문자열과 같은지.

이 문자열 비교는 앱과 테넌트 부분을 무시했다. (cud, app, public)처럼 CUD 아래의 앱으로 범위가 제한된 호출자가 CUD의 public tenant에 대한 “자기 자신”으로 통과했다. 패치 주석은 이런 주체가 “rewrite the CUD’s config, including its api_keys, which escalates to sibling apps”할 수 있다고 설명한다.

NVD에 따르면 api_keys는 이 경로에서 보호되지 않는다. 이를 덮어쓰면 상위의 자격 증명뿐 아니라 형제 애플리케이션의 자격 증명도 교체된다.

두 번째 변형

NVD는 권고문에 나온 v2 create/update 핸들러에서 선택적 식별자를 생략하면 base tenant 대상(빈 CUD, public app, public tenant)이 만들어진다고 설명한다. 취약한 코드에서는 이 대상이 권한 분기와 엔터프라이즈 기능 게이트를 건너뛰었다. 패치 주석도 같은 내용을 설명한다. 요청 본문에서 식별자를 생략하면 base tenant로 해석된다.

core config는 base tenant에 대해 별도로 거부되므로, 이 변형은 키 탈취가 아니다.

공통 원인은 대상에 대한 호출자의 신원을 확인하는 검사가 빠져 있다는 점이다. 코드는 전체 튜플이 아니라 신원의 일부(도메인 문자열)만 비교했다.

4. 익스플로잇 흐름(개념)

공격 입력은 여기에 싣지 않는다. 각 단계는 개념만 설명한다.

  1. 발판. 공격자는 공유 CUD 아래 한 애플리케이션의 유효한 API 키를 가지고 있다. 이는 해당 앱 소유자에게 의도된 정상 권한이다.
  2. 대상 선택. 공격자는 자기 앱이 아니라 상위 CUD의 public 설정을 업데이트하라고 core에 요청한다.
  3. 잘못된 권한 부여. 권한 검사는 CUD 이름이 일치하는 것을 보고 요청을 통과시킨다. 호출자가 CUD의 public app 및 tenant일 것을 요구하지 않는다.
  4. 자격 증명 교체. 업데이트로 상위의 api_keys가 교체된다. 같은 능력으로 공격자는 각 형제 애플리케이션의 키도 교체할 수 있다.
  5. 탈취. 형제 키를 장악한 공격자는 형제의 일반 API를 사용한다. 사용자를 읽거나 수정하고, 그 사용자로서 세션을 얻고, 지속적인 대시보드 사용자를 만들 수 있다.
  6. 차단. 형제 자신의 키는 더 이상 동작하지 않는다.
  1. 앱 API 키 — 낮은 권한
  2. 상위 CUD 업데이트 — 검사가 도메인 이름만 비교
  3. api_keys 교체 — 상위, 이어서 형제
  4. 형제 앱으로 행동
  5. 형제 사용자 읽기/수정, 세션 위조, 소유자 차단
개념 흐름도 — 실행 가능한 페이로드가 아닙니다

base 대상 변형은 더 짧다. 식별자를 생략한 요청이 base tenant를 대상으로 하고, 검사가 건너뛰어지며, 공격자가 로그인 팩터나 recipe 플래그를 바꾼다. NVD는 이 변형에서 키가 노출되지 않는다고 설명한다.

5. 트리거 조건

  • 배포가 멀티 테넌트이며 라이선스가 적용되어 있다. NVD 설명은 이 문제를 “in a licensed multi-tenant deployment”로 규정한다.
  • 기본값이 아닌 하나의 CUD 아래에 여러 애플리케이션이 있고, 각각 고유한 api_keys를 가진다.
  • 공격자가 그런 애플리케이션 하나의 유효한 API 키를 가지고 있고, 그 키로 core에 네트워크로 접근할 수 있다.
  • core가 영향받는 릴리스를 실행 중이다. CVE 레코드는 각 수정 버전까지의 영향 범위를 나열하며, 수정 버전은 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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, 12.3.1이다. 정확한 범위는 CVE record를 참조한다.
  • 기본 CUD를 쓰는 단일 애플리케이션 배포는 설명된 시나리오에 해당하지 않는다. 이는 코드로 확인하지 않았다.

6. 패치 분석

수정은 커밋 13c3de1에 있다. 이 커밋은 Multitenancy.java(+22/−3)를 변경하고 TestPermissionChecks.java에 테스트를 추가한다. 커밋에는 다른 커밋에서 cherry-pick했다고 표시되어 있으므로, 같은 변경이 여러 릴리스 라인에 이식되었다. OSV 레코드에는 같은 파일을 건드리는 다른 커밋이 다수 나열되어 있으며, 이는 브랜치별 백포트와 일치한다.

diff의 핵심 부분(주석은 생략):

+12−2java
  if (!sourceTenant.equals(new TenantIdentifier(null, null, null))
          && !sourceTenant.getConnectionUriDomain().equals(targetTenant.getConnectionUriDomain())) {
  boolean sourceIsBase = sourceTenant.equals(new TenantIdentifier(null, null, null));
  boolean sourceIsSameCudPublic =
          sourceTenant.getConnectionUriDomain().equals(targetTenant.getConnectionUriDomain())
          && sourceTenant.getAppId().equals(TenantIdentifier.DEFAULT_APP_ID)
          && sourceTenant.getTenantId().equals(TenantIdentifier.DEFAULT_TENANT_ID);
  if (!sourceIsBase && !sourceIsSameCudPublic) {
      throw new BadPermissionException(
          "You must use the default or same connectionUriDomain to create/update a " +
          "connectionUriDomain");
  }
 } else {
   // target is the base tenant
   if (!sourceTenant.equals(new TenantIdentifier(null, null, null))) {
     throw new BadPermissionException(
         "You must use the default tenant to create/update the base tenant");
   }
 }

기존 라인이 흐름을 깨뜨린 이유. 기존 조건은 source가 base tenant가 아니고 동시에 CUD 문자열이 다를 때만 요청을 거부했다. 그래서 CUD 문자열이 같고 앱이 public이 아닌 source는 통과했다. 새 코드는 앱 ID와 테넌트 ID도 public 기본값일 것을 요구한다. 앱 범위 키는 흐름의 3단계에서 거부된다.

base tenant 변형. 기존 코드에는 base tenant 대상에 대한 분기가 없었다. 새 else 분기는 source가 base tenant 자체일 것을 요구한다. 식별자를 생략해도 더 이상 앱 범위 호출자가 base tenant에 도달할 수 없다.

커밋 주석에 따르면 core config는 이미 base tenant에 대해 별도로 거부되고 있었으며, 이는 이 변형이 키 탈취가 아니라는 NVD의 설명과 일치한다.

다른 백포트 커밋의 diff는 검토하지 않았고, v2 핸들러 코드도 살펴보지 않았다.

7. 탐지·완화

즉시 조치

  • SuperTokens Core를 사용 중인 라인의 수정 릴리스로 업그레이드한다. CVE 레코드는 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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, 12.3.1을 나열한다. v12.3.1 release 노트에는 이것이 보안 수정으로 기재되어 있다.
  • 영향받는 멀티 테넌트 구성을 운영했다면, 공유 CUD와 그 앱들의 모든 api_keys가 노출되었을 수 있다고 간주한다. 업그레이드한 뒤에 교체한다. 업그레이드 전에 교체하는 것은 의미가 없다. 앱 키 하나만 가진 공격자가 다시 덮어쓸 수 있기 때문이다.
  • 형제 애플리케이션의 사용자, 세션, 대시보드 사용자에서 예상치 못한 추가나 변경이 없는지 검토한다.
  • base tenant의 firstFactors, 필수 보조 팩터, recipe 활성화 플래그에 계획되지 않은 변경이 없는지 확인한다.
  • 가능하면 core의 관리 API에 대한 네트워크 접근을 제한해 신뢰할 수 있는 백엔드만 접근하도록 한다.

탐지

  • 로그와 리버스 프록시 기록에서 멀티테넌시 API로 향하는 create/update 요청을 찾는다. 상위 CUD를 대상으로 하거나 테넌트 식별자를 생략한 요청 중 애플리케이션 범위 키로 이루어진 것에 주목한다.
  • api_keys의 예상치 못한 변경이나, 애플리케이션 자신의 키가 갑자기 거부되는 경우를 찾는다. NVD는 공격자가 형제의 키를 차단할 수 있다고 설명한다.
  • 권고문은 침해 지표(IoC)를 공개하지 않는다. 공개 출처에서 확인한 지표도 없다.

격리된 실습(로컬 Docker 랩)

인터넷과 격리된 로컬 Docker 랩에서만 재현한다. 외부로 나가는 접근이 없는 일회용 네트워크를 사용하고, 랩에 실제 자격 증명과 데이터를 두지 않는다.

권장 실습:

  • 권고문이 설명하는 최소한의 라이선스 적용 멀티 테넌트 구성으로 취약한 core와 수정된 core를 나란히 실행한다.
  • 앱 범위 호출자가 상위 CUD를 대상으로 할 때의 권한 판정을 비교한다.
  • 수정 커밋에 추가된 회귀 테스트를 읽고 기대되는 허용·거부 사례를 확인한다.

실제 키를 재사용하지 말고, 랩 클라이언트를 본인 소유가 아닌 시스템에 연결하지 않는다.

8. References

1. TL;DR

SuperTokens Core is an open-source authentication server. It can host several applications under one “connection URI domain” (CUD) in a multi-tenant setup. In affected versions, the permission check for creating or updating a CUD compared only the CUD name. It did not check whether the caller was the CUD’s top-level (public app, public tenant) identity.

So an API key scoped to one application could pass as the parent domain’s own identity. The caller could rewrite the domain’s configuration, including api_keys. The NVD description says this lets an attacker replace the sibling applications’ keys too. That leads to reading or changing sibling users, getting sessions as them, and locking out the real owner.

A second variant reaches the base tenant when the request omits the tenant identifier. That variant can change login-factor and recipe settings but not core config or keys. The fix (CVSS 9.9) tightens both checks. It is available in all 18 patched release lines listed in the CVE record.

2. Flaw classification

ItemValue
Primary CWECWE-639 Authorization Bypass Through User-Controlled Key. NVD also lists CWE-863 Incorrect Authorization.
Weakness locationMultitenancy.checkPermissionsForCreateOrUpdate in src/main/java/io/supertokens/multitenancy/Multitenancy.java
Attack vectorNetwork (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H, score 9.9)
ImpactPer NVD: read and modify sibling applications’ users, obtain sessions as those users, persist through a sibling dashboard user, replace API keys and lock out the legitimate owner. The base-target variant can change firstFactors, required secondary factors and recipe-enabled flags, which affects login integrity and availability.
PrerequisitesA licensed multi-tenant deployment. Several applications must sit under one non-default CUD, each with its own api_keys. The attacker needs one application’s valid API key (low privilege, no user interaction).
Scope changeYes (S:C). A credential for one app affects other apps.

3. Root cause

Background

SuperTokens identifies a request’s “source” by a tuple of CUD, app ID and tenant ID. Creating or updating a tenant, app or CUD goes through checkPermissionsForCreateOrUpdate. It compares the caller’s tuple (the source) with the object being changed (the target).

The bug

The patch comments describe the intended rule. To create or update a CUD, the caller must be either the base tenant or the public app and public tenant of the same CUD.

The vulnerable branch tested only two things:

  • whether the source was the base tenant, and
  • whether the source’s CUD string equalled the target’s CUD string.

That string comparison ignored the app and tenant parts. A caller scoped to an app under the CUD, such as (cud, app, public), passed as “self” for the CUD’s public tenant. The patch comment says such a principal could then “rewrite the CUD’s config, including its api_keys, which escalates to sibling apps.”

api_keys is not protected from this path, according to NVD. Overwriting it replaces the parent’s credential, and the sibling applications’ credentials as well.

The second variant

NVD says that in the advisory’s v2 create/update handlers, omitting the optional identifier produces a base-tenant target (empty CUD, public app, public tenant). In the vulnerable code, that target skipped the permission branches and the enterprise-feature gate. The patch comment describes the same thing: leaving out the identifier in the request body resolves to the base tenant.

Core config is refused separately for the base tenant, so this variant is not key theft.

The common cause is a missing check on who the caller is relative to the target. The code compared only part of the identity (the domain string) instead of the whole tuple.

4. Exploit flow (conceptual)

No attack input is shown here. Each step describes only the idea.

  1. Foothold. The attacker holds the valid API key of one application under a shared CUD. This is the normal, intended privilege for that app’s owner.
  2. Target selection. The attacker asks the core to update the parent CUD’s public configuration instead of their own app.
  3. Faulty authorization. The permission check sees a matching CUD name and lets the request through. It does not require the caller to be the CUD’s public app and tenant.
  4. Credential replacement. The update replaces the parent’s api_keys. The same capability then lets the attacker replace each sibling application’s keys.
  5. Takeover. With the sibling keys now under their control, the attacker uses the sibling’s normal APIs. They can read or modify users, obtain sessions as them and create a persistent dashboard user.
  6. Lockout. The sibling’s own key no longer works.
  1. app API key — low privilege
  2. update parent CUD — check compares domain name only
  3. replace api_keys — parent, then siblings
  4. act as sibling app
  5. read/modify sibling users, forge sessions, lock out owner
Conceptual flow — not an executable payload

The base-target variant is shorter. A request that omits the identifier targets the base tenant, the checks are skipped, and the attacker changes login factors or recipe flags. NVD says this variant does not expose keys.

5. Trigger conditions

  • The deployment is multi-tenant and licensed. The NVD description frames the issue “in a licensed multi-tenant deployment.”
  • Several applications live under one non-default CUD, each with its own api_keys.
  • The attacker has one such application’s valid API key, and the core is network-reachable with that key.
  • The core is running an affected release. The CVE record lists affected ranges up to each fixed version, including 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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. See the CVE record for exact ranges.
  • Single-application deployments on the default CUD do not match the described scenario. I did not verify this against the code.

6. Patch analysis

The fix is in commit 13c3de1. It changes Multitenancy.java (+22/−3) and adds tests in TestPermissionChecks.java. The commit is marked as cherry-picked from another commit, so the same change was ported across release lines. The OSV record lists many other commits touching the same file, which fits per-branch backports.

Key part of the diff (comments trimmed):

+12−2java
  if (!sourceTenant.equals(new TenantIdentifier(null, null, null))
          && !sourceTenant.getConnectionUriDomain().equals(targetTenant.getConnectionUriDomain())) {
  boolean sourceIsBase = sourceTenant.equals(new TenantIdentifier(null, null, null));
  boolean sourceIsSameCudPublic =
          sourceTenant.getConnectionUriDomain().equals(targetTenant.getConnectionUriDomain())
          && sourceTenant.getAppId().equals(TenantIdentifier.DEFAULT_APP_ID)
          && sourceTenant.getTenantId().equals(TenantIdentifier.DEFAULT_TENANT_ID);
  if (!sourceIsBase && !sourceIsSameCudPublic) {
      throw new BadPermissionException(
          "You must use the default or same connectionUriDomain to create/update a " +
          "connectionUriDomain");
  }
 } else {
   // target is the base tenant
   if (!sourceTenant.equals(new TenantIdentifier(null, null, null))) {
     throw new BadPermissionException(
         "You must use the default tenant to create/update the base tenant");
   }
 }

Why the old line broke the flow. The old condition denied the request only when the source was not the base tenant and the CUD strings differed. A source with the same CUD string but a non-public app therefore passed. The new code requires the app ID and tenant ID to be the public defaults as well. An app-scoped key is rejected at step 3 of the flow.

The base-tenant variant. The old code had no branch for a base-tenant target. The new else branch requires the source to be the base tenant itself. Omitting the identifier no longer lets an app-scoped caller reach it.

Per the commit comments, core config was already refused for the base tenant separately, which matches NVD’s note that this variant is not key theft.

I did not review the other backport commits’ diffs, and the v2 handler code was not examined.

7. Detection & mitigation

Immediate actions

  • Upgrade SuperTokens Core to a fixed release in your line. The CVE record lists 6.0.24, 7.0.23, 8.0.7, 9.0.6, 9.1.6, 9.2.7, 9.3.5, 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. The v12.3.1 release notes list this as a security fix.
  • If you ran an affected multi-tenant setup, treat all api_keys for the shared CUD and its apps as possibly exposed. Rotate them after upgrading. Rotating before upgrading would not help, since an attacker with any one app key could overwrite them again.
  • Review sibling-application users, sessions and dashboard users for unexpected additions or changes.
  • Check firstFactors, required secondary factors and recipe-enabled flags on the base tenant for unplanned changes.
  • Where possible, restrict network access to the core’s admin/management APIs so only trusted backends can reach them.

Detection

  • Look in your logs and reverse-proxy records for create/update requests to the multitenancy APIs. Pay attention to ones that target a parent CUD, or omit the tenant identifier, and that were made with an application-scoped key.
  • Look for unexpected changes to api_keys, or an application’s own key suddenly being rejected. NVD says the attacker can lock out the sibling’s key.
  • The advisory does not publish indicators of compromise. I have not confirmed any in public sources.

Isolated practice (local Docker lab)

Reproduce this only in a local Docker lab isolated from the internet. Use a throwaway network with no outbound access, and keep the lab free of real credentials and data.

Suggested exercise:

  • Run a vulnerable core and a fixed core side by side, using the minimal licensed multi-tenant layout the advisory describes.
  • Compare the authorization decision for an app-scoped caller targeting the parent CUD.
  • Read the regression tests added in the fix commit to see the expected allow and deny cases.

Do not reuse real keys, and do not point any lab client at systems you do not own.

8. References