Summary
Budibase contains a broken access control vulnerability in the data-source query endpoint, allowing BASIC users to bypass configured per-table permissions. An attacker with a valid low-privilege account may read, create, update, or delete rows in tables that should be restricted to them.
Affected context
The issue affects Budibase deployments where the POST /api/datasources/query endpoint relies on request-supplied table identifiers without consistently enforcing the authenticated user's table-level role restrictions. The risk is present when a BASIC user can reach the endpoint and the server does not independently authorize the requested table and operation before processing the query.
Exploit preconditions
- Attack surface: The Budibase data-source query API
- Required access: A valid account with the BASIC role
- Trigger point: A crafted POST request submitted to
/api/datasources/query - Required condition: The request must identify a table and operation that the account should not be permitted to perform
- Why exploitation is possible: Authorization is not consistently evaluated against the target table and requested action, allowing client-controlled identifiers to bypass configured restrictions
Why this happens
The underlying bug is an authorization enforcement failure mapped to CWE-862: Missing Authorization. The endpoint accepts a requested table and data operation but does not reliably perform a server-side permission check for that specific resource and action. This creates a trust-boundary failure in which authenticated identity is treated as sufficient authorization, even when table-level restrictions should apply.
Potential impact
- Unauthorized reading of sensitive table contents
- Creation of rows in restricted tables
- Modification or deletion of existing data
- Data integrity loss and business workflow disruption
- Exposure of information across tenant or role boundaries
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the point where each data operation is executed.
Common defensive patterns include:
- Applying server-side, deny-by-default authorization checks to every requested table and operation
- Treating table identifiers and operation types as untrusted input
- Centralizing permission evaluation so all query paths use the same policy
- Preventing clients from overriding or bypassing resource-level role decisions
- Restricting service-account and database privileges to the minimum required scope
- Returning consistent authorization failures without disclosing restricted resource details
How teams detect issues like this
Organizations can assess for this class of issue through:
- Static analysis and code review checks for endpoints that use client-supplied resource identifiers without adjacent authorization logic
- Review of query handlers to confirm that read, create, update, and delete operations each enforce resource-level permissions
- Integration tests covering every role against permitted and restricted tables
- API monitoring for BASIC users accessing unusual tables or performing unexpected write and delete operations
- Policy enforcement requiring centralized authorization middleware for data-access endpoints
- Neutral automated security review tools that flag missing authorization checks and inconsistent access-control paths

