Summary
ToolJet Database versions before v3.16.44 contain a privilege escalation flaw in the join_tables endpoint. An authenticated user may read tables from another workspace by supplying its identifier because the endpoint does not properly validate roles or workspace membership.
Affected context
The vulnerability occurs in ToolJet Database deployments where the join_tables endpoint is available to authenticated users and authorization is not enforced against the requested workspace. It becomes risky when a caller can submit a different workspace identifier in the request path and the service relies on authentication alone rather than validating workspace membership and permissions.
Exploit preconditions
- Attack surface: Authenticated HTTP access to the
join_tablesendpoint - Required access: A valid ToolJet account with credentials for any workspace
- Trigger point: A request that references a workspace identifier outside the caller's authorized scope
- Why exploitation is possible: The endpoint grants the JOIN_TABLES ability broadly and does not consistently verify role or workspace membership before accessing database tables
Why this happens
The underlying bug is an authorization failure in a multi-tenant API. The endpoint treats authentication and possession of a workspace identifier as sufficient authority, without enforcing object-level access control for the requested workspace. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, where a user-controlled identifier can select a protected object without an effective permission check.
Potential impact
- An attacker may read database tables belonging to other workspaces
- Sensitive tenant data could be exposed across workspace boundaries
- Unauthorized users could gain capabilities intended for higher-privileged roles
- The incident could undermine tenant isolation and compliance controls
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the resource and tenant boundaries rather than relying on authentication alone.
Common defensive patterns include:
- Require explicit role and workspace-membership checks for every
join_tablesrequest - Derive the authorized workspace scope from the authenticated session or token where possible
- Treat workspace identifiers supplied by clients as untrusted selectors
- Apply deny-by-default authorization for database capabilities
- Centralize object-level authorization checks to reduce endpoint-specific omissions
- Run automated tests covering cross-workspace and cross-role access attempts
- Return consistent authorization failures without revealing whether protected resources exist
How teams detect issues like this
Organizations can look for:
- Static analysis and code review checks for endpoints that authorize users without validating resource ownership or tenant membership
- Signals where route parameters or request-body identifiers are used directly in database queries
- Missing authorization middleware on database-management endpoints
- Tests that exercise access using valid credentials paired with identifiers from another workspace
- Audit logs showing repeated requests for foreign workspace identifiers or unusual table-access patterns
API security testing and automated code review tools can help identify missing object-level authorization checks.

