GHSA-FCRW-F7GG-6G9F

GHSA-FCRW-F7GG-6G9F is a medium-severity security vulnerability in @budibase/server (npm), affecting versions < 3.39.25. It is fixed in 3.39.25.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Budibase: SSO OAuth2 Token Leakage via User Metadata Endpoints to Power-Role Users

The /api/users/metadata and /api/users/metadata/:id endpoints in @budibase/server return full global user profiles to any user with POWER role or above. For SSO-authenticated users (OIDC, Google), the response includes oauth2.accessToken and oauth2.refreshToken fields, leaking identity provider credentials to other users who should not have access to them.

Details

When a user authenticates via SSO (OIDC or Google), the OAuth2 tokens are stored in the global CouchDB user document at packages/backend-core/src/auth/auth.ts:170-173:

dbUser.oauth2 = {
  ...dbUser.oauth2,
  ...details,
}
await db.put(dbUser)

The user metadata endpoints are protected by PermissionType.USER, PermissionLevel.READ (packages/server/src/api/routes/user.ts:11), which maps to the POWER permission set (packages/backend-core/src/security/permissions.ts:99).

Path 1, List all users (GET /api/users/metadata):

  1. controller.fetchMetadatasdk.users.fetchMetadata() (packages/server/src/sdk/users/utils.ts:78)
  2. getGlobalUsers()getRawGlobalUsers() (packages/server/src/utilities/global.ts:101-122), strips only password and forceResetPassword
  3. processUser() (packages/server/src/utilities/global.ts:15-76), strips only password and roles
  4. The oauth2 field containing accessToken and refreshToken is never removed

Path 2, Single user (GET /api/users/metadata/:id):

  1. controller.findMetadatagetFullUser() (packages/server/src/utilities/users.ts:6)
  2. getGlobalUser()getRawGlobalUser() (packages/server/src/utilities/global.ts:90-92), raw CouchDB fetch, no field stripping at all
  3. processUser(), strips only password and roles
  4. Same result: oauth2 tokens are returned

There is no output sanitization middleware on these routes that would strip sensitive fields before the response reaches the client.

PoC

Prerequisites: A Budibase instance with at least one SSO-authenticated user (OIDC or Google) and a separate user with POWER role in an app.

Step 1, As the POWER user, list all users:

curl -s -X GET 'http://localhost:10000/api/users/metadata' \
  -H 'Cookie: budibase:auth=<power-user-jwt>' \
  -H 'x-budibase-app-id: app_<appid>' | jq '.[].oauth2'

Expected output: null for all users (tokens should not be exposed)

Actual output: For SSO users, the response includes:

{
  "accessToken": "ya29.a0ARrdaM...",
  "refreshToken": "1//0eXxXxXxXx..."
}

Step 2, Fetch a specific SSO user's profile:

curl -s -X GET 'http://localhost:10000/api/users/metadata/ro_ta_users_us_<sso-user-id>' \
  -H 'Cookie: budibase:auth=<power-user-jwt>' \
  -H 'x-budibase-app-id: app_<appid>' | jq '.oauth2'

This also returns the full OAuth2 tokens.

Impact

  • A user with POWER role in any app can read all SSO users' OAuth2 access tokens and refresh tokens via the list endpoint, without needing to know individual user IDs.
  • Stolen access tokens can be used to access external identity provider resources (Google Workspace, Azure AD, Okta-protected services) as the victim user.
  • Refresh tokens allow indefinite token renewal, persisting access even after the original access token expires.
  • Additionally, admin, builder, tenantId, ssoId, and userGroups fields are leaked, revealing the full authorization topology of the instance.

GHSA-FCRW-F7GG-6G9F has a CVSS score of 4.9 (Medium). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (3.39.25); upgrading removes the vulnerable code path.

Affected versions

@budibase/server (< 3.39.25)

Security releases

@budibase/server → 3.39.25 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Strip sensitive SSO fields in processUser() at packages/server/src/utilities/global.ts:15:

export async function processUser(
  user: ContextUser,
  opts: { appId?: string; groups?: UserGroup[] } = {}
) {
  if (!user || (!user.roles && !user.userGroups)) {
    return user
  }
  user = cloneDeep(user)
  delete user.password
+ delete (user as any).oauth2
+ delete (user as any).provider
+ delete (user as any).providerType
+ delete (user as any).thirdPartyProfile
+ delete (user as any).profile
+ delete (user as any).ssoId
+ delete (user as any).forceResetPassword
  // ... rest of function

Additionally, getRawGlobalUsers() at line 101 should also strip oauth2 alongside its existing password/forceResetPassword stripping for defense in depth.

Frequently Asked Questions

  1. What is GHSA-FCRW-F7GG-6G9F? GHSA-FCRW-F7GG-6G9F is a medium-severity security vulnerability in @budibase/server (npm), affecting versions < 3.39.25. It is fixed in 3.39.25.
  2. How severe is GHSA-FCRW-F7GG-6G9F? GHSA-FCRW-F7GG-6G9F has a CVSS score of 4.9 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of @budibase/server are affected by GHSA-FCRW-F7GG-6G9F? @budibase/server (npm) versions < 3.39.25 is affected.
  4. Is there a fix for GHSA-FCRW-F7GG-6G9F? Yes. GHSA-FCRW-F7GG-6G9F is fixed in 3.39.25. Upgrade to this version or later.
  5. Is GHSA-FCRW-F7GG-6G9F exploitable, and should I be worried? Whether GHSA-FCRW-F7GG-6G9F is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-FCRW-F7GG-6G9F is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-FCRW-F7GG-6G9F? Upgrade @budibase/server to 3.39.25 or later.

Other vulnerabilities in @budibase/server

Stop the waste.
Protect your environment with Kodem.