/

CVE-2026-77240

Severity:

CRITICAL RISK

(9.9)

Authorization Bypass (CWE-639) in WACRM Supabase DB

CVE-2026-77240

Deferred

Vulnerability type

Category:

Authorization Bypass

CWE:

CWE-639

Impact:

Cross-Tenant Data Exposure and Privilege Escalation

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/ArnasDon/wacrm/commit/e01f7ed37184f972ace8fb2da5c3e37e56a6050f
github.comgithub.com/ArnasDon/wacrm/pull/350
github.comgithub.com/ArnasDon/wacrm/security/advisories/GHSA-fg5p-2qc3-jmxr

Frequently asked

questions

An authenticated user may be able to exploit it if the deployment exposes the affected profile update policy or knowledge-search functions without additional authorization controls.

No. The key condition is authenticated access combined with the ability to submit or modify a tenant or account identifier that the database does not independently validate.

Keep tenant identity and role attributes outside ordinary user-controlled updates, and enforce membership and ownership checks inside every tenant-scoped database operation.

Use deny-by-default row-level security, server-derived tenant context, least-privilege security-definer functions, and automated tests covering cross-tenant access attempts.

Find out what's already
exploitable in your codebase.