Summary
Flowise exposes an authorization flaw in the /api/v1/chatflows/apikey/:apikey endpoint that leaks configuration details of chatflows from other workspaces.
When the keyonly parameter is omitted, the endpoint returns chatflows without API keys from all workspaces, allowing a user with any valid API key to obtain sensitive configuration metadata across tenants.
Affected context
This vulnerability occurs in Flowise deployments where multiple workspaces (tenants) share the same Flowise instance and the /api/v1/chatflows/apikey/:apikey endpoint is exposed.
It becomes relevant when chatflows exist without an API key assigned and the endpoint is called without the keyonly query parameter.
In such cases, the underlying database query does not enforce workspace scoping, allowing responses to include unprotected chatflows from other workspaces.
Exploit preconditions
- Attack surface: HTTP API endpoint
/api/v1/chatflows/apikey/:apikey. - Required access: Possession of any valid API key associated with at least one workspace.
- Trigger point: Calling the endpoint without the
keyonlyquery parameter set (or with it omitted, relying on the default behavior). - Why exploitation is possible: The backend query filters by API key but omits any workspace or tenant filter for chatflows that lack an API key, causing unscoped data to be included in the response.
Why this happens
The root cause is an authorization design flaw where access control decisions are made solely on the presence of a valid API key, without consistently enforcing tenant or workspace boundaries.
Specifically, the query used by /api/v1/chatflows/apikey/:apikey does not apply a workspace filter for chatflows without an API key, resulting in a cross-tenant data exposure.
This maps to CWE-863: Incorrect Authorization, where the system fails to properly verify whether a user (or API client) is authorized to access specific resources, especially in a multi-tenant context.
Conceptually, this reflects a pattern where resource scoping rules (e.g., workspace_id constraints) are not systematically applied across all query branches and conditions.
Potential impact
- An attacker with any valid API key may obtain full ChatFlow configurations from other workspaces.
- Sensitive system prompts and node configurations used to encode business logic or proprietary workflows could be exposed.
- Chatbot behavior, routing rules, and API configuration details may be inferred or replicated by unauthorized parties.
- Credential identifiers (though not necessarily secrets themselves) can be enumerated, aiding further targeted attacks or social engineering.
- Tenants may lose confidentiality of their internal conversation flows and operational models.
General mitigation guidance
Effective mitigation centers on enforcing strict, consistent authorization checks for all resource queries:
- Apply mandatory workspace or tenant scoping in every query that returns chatflows, regardless of whether an API key is present.
- Design access control around resource ownership (e.g., workspace_id) rather than incidental attributes such as API keys alone.
- Introduce centralized authorization helpers or middleware that enforce multi-tenant boundaries by default, so no endpoint can bypass them.
- Prefer explicit, least-privileged API endpoints that return only the minimal data necessary for the caller's use case.
- Consider separating public/unauthenticated resources from private, tenant-bound resources to avoid mixed-scope query logic.
How teams detect issues like this
Detection can focus on both code-level patterns and runtime behavior:
- Use static analysis or code review checklists to identify API handlers that:
- Query shared tables (e.g., chatflows) without an explicit workspace or tenant filter.
- Make authorization decisions based only on API key presence, without resource ownership checks.
- Implement automated tests that simulate multiple tenants and verify that cross-tenant data is never returned for scoped endpoints.
- Monitor API logs for patterns where a single API key accesses unusually large or diverse sets of chatflows across multiple workspaces.
- Consider integrating security-focused linters or policy-as-code tools to enforce that all data access paths apply tenant scoping predicates.

