{"vuln_id":"GHSA-25qc-m4pw-2w8r","aliases":["CVE-2026-122247"],"description":"Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)","published_at":"2026-11-20T23:50:01Z","modified_at":"2026-11-21T00:00:03.990701Z","first_seen_at":"2026-11-21T19:15:19.243945Z","severity":"high","severity_source":"ghsa","cvss_score":8.2,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H","cwe":["CWE-284","CWE-306","CWE-770","CWE-863"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-25qc-m4pw-2w8r"},"matched_alias":null,"items":[{"id":10801,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-25qc-m4pw-2w8r: Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)","summary":"Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)\n\n## Description\n\n### Summary\n\nOn a self-hosted, single-tenant Budibase instance (`multiTenancy:false`), the public bootstrap endpoint `POST /api/global/users/init` remains fully exploitable **after** the instance has been provisioned. Its \"already initialised\" guard (`checkAnyUserExists()`) is evaluated inside a **tenant-scoped** database context derived from an **attacker-controlled `tenantId`** in the request body. Because the tenancy layer never constrains that `tenantId` to the only legitimate tenant (`default`) on a single-tenant deployment, an unauthenticated attacker simply supplies any unused tenant name to make the guard see an empty user list, and the endpoint then creates a brand-new CouchDB database (`\n_global-db`) and a **global-admin** user document (`admin.global = true`, `builder.global = true`) inside it - with no authentication and no CSRF token.\n\nThis is (a) a bypass of the security control meant to permanently close first-run setup, and (b) an unauthenticated, persistent write primitive that lets an anonymous attacker create an unbounded number of databases and admin-user documents - a resource-exhaustion / denial-of-service vector against the CouchDB datastore, plus creation of latent rogue admin accounts.\n\n### Details\n\nRoot cause chain (source, tag v3.44.0):\n\n1. `packages/worker/src/api/index.ts:41` - `POST /api/global/users/init` is in `PUBLIC_ENDPOINTS`, so `auth.buildAuthMiddleware(PUBLIC_ENDPOINTS)` marks it `publicEndpoint` and the \"no public access to worker\" gate (`api/index.ts:159-165`) lets it through **without any session**. It is also in `NO_TENANCY_ENDPOINTS` (`api/index.ts:83`), so the tenancy middleware does **not** pin the request to `default` - the tenant is taken verbatim from the request body - and in `NO_CSRF_ENDPOINTS`.\n2. `packages/worker/src/middleware/cloudRestricted.ts:10,25` - the `cloudRestricted` guard only enforces the internal API key when `!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL`. On a self-hosted instance (`SELF_HOSTED=true`) it is a **no-op** (`return next()`), so `cloudRestrictedRoutes` provides no protection here.\n3. `packages/worker/src/api/routes/global/users.ts:69-79` - `cloudRestrictedRoutes.post(\"/api/global/users/init\", … controller.adminUser)`.\n4. `packages/worker/src/api/controllers/global/users.ts:232` - the handler runs `await tenancy.doInTenant(tenantId, …)` using the **attacker-supplied** `tenantId`.\n5. `packages/worker/src/api/controllers/global/users.ts:238` - the only guard, `const userExists = await checkAnyUserExists()`, throws 403 only if a user exists **in the current tenant context**.\n6. `packages/worker/src/utilities/users.ts:3-15` - `checkAnyUserExists()` calls `tenancy.getGlobalDB()`, which resolves to `\n_global-db`. For any unused `tenantId` this DB is empty → the guard passes → `userSdk.db.createAdminUser(email, tenantId, …)` (`users.ts:247`) creates a full global admin.\n\nThe defect is **incorrect authorization scoping**: the single-tenant de\n\nAffected: npm:@budibase/server\n\nNo fixed version published yet\n\nReferences:\nhttps://github.com/Budibase/budibase/security/advisories/GHSA-25qc-m4pw-2w8r\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-122247\nhttps://github.com/Budibase/budibase/commit/362a7fe9aea594531ece1cf15be76cc00bfb88b9\nhttps://github.com/Budibase/budibase\nhttps://github.com/Budibase/budibase/releases/tag/v3.50.0\nhttps://github.com/Budibase/budibase/releases/tag/v4.0.0","url":"https://osv.dev/vulnerability/GHSA-25qc-m4pw-2w8r","published_at":"2026-11-20T23:50:01Z","updated_at":"2026-11-21T00:00:03.990701Z","fetched_at":"2026-11-21T19:15:55.946185Z","severity":"high","cvss_score":8.2,"epss":0.00838,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@budibase/server","vuln_id":"CVE-2026-122247","vuln_ids":["CVE-2026-122247","GHSA-25QC-M4PW-2W8R"],"tags":["osv","npm","no-fix-yet"],"cluster_id":1974,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10801","html":"https://vulnwatch.ve1ve2.com/item/10801"}},{"id":2279,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-25qc-m4pw-2w8r / CVE-2026-122247: Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)","summary":"Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)\n\n## Description\n\n### Summary\n\nOn a self-hosted, single-tenant Budibase instance (`multiTenancy:false`), the public bootstrap endpoint `POST /api/global/users/init` remains fully exploitable **after** the instance has been provisioned. Its \"already initialised\" guard (`checkAnyUserExists()`) is evaluated inside a **tenant-scoped** database context derived from an **attacker-controlled `tenantId`** in the request body. Because the tenancy layer never constrains that `tenantId` to the only legitimate tenant (`default`) on a single-tenant deployment, an unauthenticated attacker simply supplies any unused tenant name to make the guard see an empty user list, and the endpoint then creates a brand-new CouchDB database (`\n_global-db`) and a **global-admin** user document (`admin.global = true`, `builder.global = true`) inside it - with no authentication and no CSRF token.\n\nThis is (a) a bypass of the security control meant to permanently close first-run setup, and (b) an unauthenticated, persistent write primitive that lets an anonymous attacker create an unbounded number of databases and admin-user documents - a resource-exhaustion / denial-of-service vector against the CouchDB datastore, plus creation of latent rogue admin accounts.\n\n### Details\n\nRoot cause chain (source, tag v3.44.0):\n\n1. `packages/worker/src/api/index.ts:41` - `POST /api/global/users/init` is in `PUBLIC_ENDPOINTS`, so `auth.buildAuthMiddleware(PUBLIC_ENDPOINTS)` marks it `publicEndpoint` and the \"no public access to worker\" gate (`api/index.ts:159-165`) lets it through **without any session**. It is also in `NO_TENANCY_ENDPOINTS` (`api/index.ts:83`), so the tenancy middleware does **not** pin the request to `default` - the tenant is taken verbatim from the request body - and in `NO_CSRF_ENDPOINTS`.\n2. `packages/worker/src/middleware/cloudRestricted.ts:10,25` - the `cloudRestricted` guard only enforces the internal API key when `!env.SELF_HOSTED && !env.DISABLE_ACCOUNT_PORTAL`. On a self-hosted instance (`SELF_HOSTED=true`) it is a **no-op** (`return next()`), so `cloudRestrictedRoutes` provides no protection here.\n3. `packages/worker/src/api/routes/global/users.ts:69-79` - `cloudRestrictedRoutes.post(\"/api/global/users/init\", … controller.adminUser)`.\n4. `packages/worker/src/api/controllers/global/users.ts:232` - the handler runs `await tenancy.doInTenant(tenantId, …)` using the **attacker-supplied** `tenantId`.\n5. `packages/worker/src/api/controllers/global/users.ts:238` - the only guard, `const userExists = await checkAnyUserExists()`, throws 403 only if a user exists **in the current tenant context**.\n6. `packages/worker/src/utilities/users.ts:3-15` - `checkAnyUserExists()` calls `tenancy.getGlobalDB()`, which resolves to `\n_global-db`. For any unused `tenantId` this DB is empty → the guard passes → `userSdk.db.createAdminUser(email, tenantId, …)` (`users.ts:247`) creates a full global admin.\n\nThe defect is **incorrect authorization scoping**: the single-tenant de\n\nAffected packages: npm:@budibase/server","url":"https://github.com/advisories/GHSA-25qc-m4pw-2w8r","published_at":"2026-11-20T23:50:01Z","updated_at":"2026-11-20T23:50:04Z","fetched_at":"2026-11-21T19:15:18.416716Z","severity":"high","cvss_score":8.2,"epss":0.00838,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@budibase/server","vuln_id":"CVE-2026-122247","vuln_ids":["CVE-2026-122247","GHSA-25QC-M4PW-2W8R"],"tags":["ghsa","npm","CWE-284","CWE-306","CWE-770","CWE-863"],"cluster_id":1974,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2279","html":"https://vulnwatch.ve1ve2.com/item/2279"}},{"id":9917,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-122247: Budibase is an open-source low-code platform. Prior to 3.50.0, the public POST /api/global/users/init endpoint on a self-hosted single-tenant deployment accept…","summary":"Budibase is an open-source low-code platform. Prior to 3.50.0, the public POST /api/global/users/init endpoint on a self-hosted single-tenant deployment accepts an attacker-controlled tenantId and evaluates checkAnyUserExists() in the selected tenant database instead of the legitimate default tenant. An unauthenticated attacker can select an unused tenant namespace to bypass the one-time initialization guard, causing packages/worker/src/api/controllers/global/users.ts to create a tenant-specific CouchDB database and a global-administrator document without a session or CSRF token. Repeating this operation with unique tenant identifiers can exhaust datastore resources and leave latent privileged records. The created administrator cannot log into the default tenant while multi-tenancy remains disabled, which limits the immediate impact to persistent writes, denial of service, and records that may become usable during later multi-tenant operation or migration. This issue is fixed in versions 3.50.0 and 4.0.0.\n\nReferences:\nhttps://github.com/Budibase/budibase/commit/362a7fe9aea594531ece1cf15be76cc00bfb88b9\nhttps://github.com/Budibase/budibase/releases/tag/v3.50.0\nhttps://github.com/Budibase/budibase/releases/tag/v4.0.0\nhttps://github.com/Budibase/budibase/security/advisories/GHSA-25qc-m4pw-2w8r","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-122247","published_at":"2026-11-20T17:18:08.170000Z","updated_at":"2026-11-20T17:18:08.333000Z","fetched_at":"2026-11-21T19:15:31.485416Z","severity":"high","cvss_score":8.2,"epss":0.00838,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-122247","vuln_ids":["CVE-2026-122247","GHSA-25QC-M4PW-2W8R"],"tags":["CWE-284","CWE-306","CWE-770","CWE-863"],"cluster_id":1975,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/9917","html":"https://vulnwatch.ve1ve2.com/item/9917"}}]}