Summary
Coze Studio does not adequately verify that table names used by workflow SQL customization nodes belong to the caller's workspace. An authenticated attacker who can identify predictable table identifiers may execute SQL statements against other workspaces' memory databases, potentially reading, inserting, or deleting data.
Affected context
The vulnerability occurs in Coze Studio workflow SQL customization nodes when table references are accepted without reliably enforcing workspace ownership. It is most relevant in deployments where authenticated users can create or run workflows and where memory-database table identifiers are predictable or otherwise discoverable.
Exploit preconditions
- Attack surface: Workflow SQL customization nodes and their database operations
- Required access: An authenticated Coze Studio account with permission to create, configure, or execute relevant workflows
- Trigger point: Processing a SQL customization node that references a table identifier
- Why exploitation is possible: Authorization checks do not adequately bind the requested table to the caller's workspace, allowing cross-workspace database operations
Why this happens
The underlying flaw is an authorization failure caused by validating the requested resource identifier without enforcing its ownership or tenancy context. This maps to CWE-863: Incorrect Authorization, because the application permits an authenticated caller to perform operations on tables outside the caller's authorized workspace. Predictable identifiers can make unauthorized resource selection easier, but the fundamental issue is the missing server-side authorization boundary.
Potential impact
- An attacker may read data stored in another workspace's memory database
- An attacker could insert or alter records belonging to another workspace
- An attacker could delete or corrupt cross-workspace data
- Workflows or downstream services may process attacker-controlled or tampered data
- Confidentiality and isolation between tenant workspaces may be weakened
General mitigation guidance
Mitigation generally focuses on enforcing authorization at the resource-operation boundary rather than trusting user-supplied table names.
Common defensive patterns include:
- Resolve table identifiers through server-side workspace ownership checks
- Bind every database operation to the authenticated caller's tenant and workspace context
- Avoid exposing predictable identifiers when opaque, scoped references are practical
- Apply allowlisted SQL operations and server-controlled table mappings for workflow nodes
- Enforce least-privilege database permissions and separate tenant data where feasible
- Treat workflow configuration and SQL customization input as untrusted
- Use fail-closed behavior when ownership, workspace context, or resource existence cannot be verified
How teams detect issues like this
Organizations can assess this class of issue through:
- Static analysis and code review for authorization checks that occur only at workflow or endpoint level
- Review of database access paths for direct use of user-controlled table names
- Tests that attempt cross-workspace resource access with valid accounts from different tenants
- Policy checks requiring tenant or workspace context in repository, lookup, update, and delete operations
- Monitoring for unusual SQL activity, repeated table-identifier enumeration, or access attempts across workspace boundaries
- Automated security review tools that flag missing object-level authorization and insecure direct object references

