Summary
A broken access control vulnerability in ToolJet allows authenticated Builder users to perform database schema operations against organizations other than their own. By supplying another organization's identifier to tooljet-db endpoints, an attacker may disclose schemas, alter tables, or delete tenant data when organization membership is not independently verified.
Affected context
The issue occurs in ToolJet deployments before the affected security fix where tooljet-db endpoints accept an organizationId path parameter but do not sufficiently confirm that the authenticated Builder belongs to that organization. The vulnerable context includes schema-related operations that read, create, modify, or delete tables across tenant boundaries. Exploitation becomes risky when organization identifiers can be obtained from publicly accessible application endpoints and the attacker has Builder-level access to ToolJet.
Exploit preconditions
- Attack surface: Authenticated tooljet-db schema operation endpoints
- Required access: A valid ToolJet account with Builder privileges
- Target information: A victim organization identifier, which may be discoverable through public application endpoints
- Trigger point: Requests that provide the victim organizationId to schema management operations
- Why exploitation is possible: Authorization checks do not reliably bind the requested organization to the authenticated user's tenant membership
Why this happens
The underlying flaw is an object-level authorization failure involving a tenant identifier supplied by the client. The application uses the organizationId path parameter to select database resources without consistently verifying that the requesting principal is authorized for that organization. This behavior maps to CWE-639: Authorization Bypass Through User-Controlled Key, because a user-controlled key can influence access to another tenant's objects.
Potential impact
- Attackers may disclose victim table schemas and database structure
- Attackers could create malicious or unauthorized tables in another organization
- Existing schemas may be altered or corrupted
- Victim data may be permanently deleted
- Cross-tenant confidentiality, integrity, and availability may be compromised
- Malicious schema changes could support follow-on data poisoning or application abuse
General mitigation guidance
Mitigation generally focuses on enforcing server-side, tenant-aware authorization for every schema operation.
Common defensive patterns include:
- Deriving the effective organization from the authenticated session or authorization context rather than trusting a client-supplied tenant identifier
- Performing an explicit membership and permission check before every read, create, update, or delete operation
- Applying centralized authorization middleware consistently across all tooljet-db endpoints
- Using deny-by-default policies and least-privilege Builder permissions
- Separating tenant data access at the database layer where practical
- Avoiding exposure of sensitive organization identifiers through public application responses
- Recording and reviewing cross-tenant authorization failures and destructive schema actions
How teams detect issues like this
Organizations can look for:
- Static analysis patterns where path parameters or request fields directly select tenant-scoped records
- Code review findings showing resource lookup before membership or ownership validation
- Endpoint tests that replay valid requests with organization identifiers belonging to another tenant
- Policy checks requiring authorization middleware on every tenant-scoped route
- Audit events involving repeated organizationId changes, cross-tenant authorization failures, schema creation, or destructive operations
- Automated API security testing and code review tools that identify missing object-level authorization checks

