Summary
WACRM contains improper authorization checks in flow and automation routes that verify account membership but do not require the agent role for privileged operations. A user with viewer-level access may create, modify, activate, or delete workflows and trigger outbound WhatsApp actions through service-role database operations.
Affected context
The vulnerability affects WACRM deployments using flow and automation API routes where viewer access is accepted before service-role database operations are performed. It becomes risky when a read-only account can reach these endpoints and the application does not independently enforce the role required for writes or outbound actions.
Exploit preconditions
- Attack surface: Flow and automation API routes
- Required access: An authenticated account with viewer-level membership access
- Trigger point: Requests that create, edit, activate, delete, or execute flows and automations
- Why exploitation is possible: Membership checks occur without a corresponding agent-role authorization check, while service-role database operations bypass row-level security policies
Why this happens
The underlying bug is a failure to enforce authorization at the operation boundary. The application treats membership authentication as sufficient for privileged changes, then uses a service-role database client that bypasses normal row-level security controls. This maps to CWE-285: Improper Authorization, because the system does not verify that the authenticated principal has the role required for the requested action.
Potential impact
- A viewer may modify or activate workflows
- A viewer could delete flows or cause destructive configuration changes
- Unauthorized automations may send outbound WhatsApp messages
- Business processes and customer communications may be disrupted
- Attackers could abuse trusted service-role operations to bypass data access policies
General mitigation guidance
Mitigation generally focuses on enforcing authorization for every privileged operation, including operations performed through service-role clients.
Common defensive patterns include:
- Apply explicit role and permission checks at each flow and automation write endpoint
- Use deny-by-default authorization for activation, deletion, and outbound actions
- Avoid treating membership authentication as permission to modify resources
- Minimize service-role database usage and constrain it to narrowly scoped operations
- Preserve row-level security and enforce equivalent application-layer checks when elevated clients are unavoidable
- Separate read-only and mutation routes, with distinct policy requirements
- Require audit logging and review for workflow activation and outbound messaging
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code review checks for service-role clients used after membership-only authorization
- Route-level policy reviews comparing required roles with the sensitivity of each operation
- Tests that attempt privileged flow and automation actions using viewer accounts
- Runtime monitoring for unexpected workflow changes, deletions, activations, or outbound message triggers
- Policy enforcement requiring explicit authorization middleware on mutation and action endpoints
- Automated review tools that flag authorization checks missing from privileged API paths

