Summary
WACRM contains authorization weaknesses in its Supabase policies and security-definer functions that can break tenant isolation. An authenticated user may be able to change their account role or tenant identifier, or read another tenant's AI knowledge-base data when membership checks are omitted.
Affected context
The issue affects WACRM deployments using the vulnerable Supabase migrations and multi-tenant account model. Risk is present where authenticated users can update account-related fields through the profiles_update row-level security policy, or where AI knowledge searches invoke security-definer functions that trust a caller-supplied account identifier without verifying tenant membership.
Exploit preconditions
- Attack surface: Authenticated application and Supabase database operations
- Required access: A valid authenticated user account
- Trigger points: Profile updates or calls to AI knowledge search functions
- Why exploitation is possible: Authorization decisions rely on user-controlled account fields or omit verification that the caller belongs to the requested tenant
Why this happens
The vulnerability is caused by broken object-level and function-level authorization in a multi-tenant database design. The profile update policy permits users to modify authorization-sensitive fields such as account_role and account_id, while the security-definer knowledge functions accept a caller-controlled tenant identifier without enforcing membership. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because access decisions can be influenced by identifiers supplied or modified by the user.
Potential impact
- An authenticated viewer may elevate their account role
- A user may move into another tenant's account context
- Attackers could read another tenant's knowledge-base chunks
- Attackers could access or modify tenant-scoped resources
- Cross-tenant confidentiality and integrity could be compromised
- The issue could enable broader administrative or data abuse depending on database privileges
General mitigation guidance
Mitigation generally focuses on making tenant identity and authorization server-controlled rather than user-controlled.
Common defensive patterns include:
- Excluding role, tenant, and ownership fields from user-controlled update paths
- Enforcing immutable tenant association through trusted server-side logic
- Checking authenticated identity and tenant membership inside every security-definer function
- Deriving the target account from the session context instead of accepting arbitrary account identifiers
- Applying least-privilege database roles and narrowly scoped function permissions
- Using deny-by-default row-level security policies with explicit ownership and membership predicates
- Separating administrative account-management operations from ordinary profile updates
How teams detect issues like this
Organizations can assess for this class of issue through:
- Static analysis of row-level security policies for writable authorization attributes
- Code review of database functions that use
SECURITY DEFINER - Searches for caller-controlled tenant, account, owner, or resource identifiers
- Tests that attempt cross-tenant reads and writes using authenticated non-members
- Policy checks requiring membership validation before every tenant-scoped operation
- Database audit logging for changes to roles, tenant identifiers, and security-sensitive profile fields
Automated security review tools may help identify missing authorization predicates, but authorization behavior should also be verified with tenant-isolation tests.

