Описание
Flowise: Cross-Workspace Chatflow Disclosure via chatflows/apikey Endpoint Returns All Unprotected Chatflows
Summary
The /api/v1/chatflows/apikey/:apikey endpoint (whitelisted, accessible with API key auth only) returns all chatflows bound to the provided API key AND all chatflows across the entire system that have no API key assigned. This crosses workspace boundaries, allowing a user in Workspace A who has a valid API key to read the full configuration (including flowData, chatbotConfig, system prompts, and node configurations) of chatflows from Workspace B, Workspace C, and all other workspaces, as long as those chatflows have no API key assigned.
Details
The controller at packages/server/src/controllers/chatflows/index.ts:90-107 validates the API key and calls the service:
The service at packages/server/src/services/chatflows/index.ts:223-245 builds the database query:
When keyonly is not provided as a query parameter (which is the default case), the query expands to include:
- All chatflows bound to the provided API key (same workspace, expected behavior)
- ALL chatflows with
apikeyid IS NULL(any workspace, no workspace filter) - ALL chatflows with empty
apikeyid(any workspace, no workspace filter)
There is NO workspaceId filter in this query. The response includes the full ChatFlow entity, which contains:
flowData- the complete workflow graph including system prompts, model names, internal URLs, custom codechatbotConfig- chatbot configuration including allowed originsapiConfig- API configuration and override settingstextToSpeech/speechToText- TTS/STT configuration including credential IDsanalytic- analytics configuration
PoC
Impact
- Cross-Workspace Information Disclosure: A user in any workspace can read the full configuration of chatflows from all other workspaces that do not have an API key assigned. This breaks workspace isolation.
- Intellectual Property Exposure: System prompts, custom function code, and workflow architecture of chatflows from other workspaces/organizations are exposed.
- Credential Reference Leakage: The
textToSpeechandspeechToTextfields include credential IDs, which can be abused via the TTS generate endpoint. - Amplified by Default: Most chatflows are created without an API key assigned (API keys are opt-in), so the majority of chatflows in a multi-workspace deployment are affected.
Recommended Fix
Add workspace scoping to the getChatflowByApiKey query by passing the API key workspace ID and filtering the OR clause:
Пакеты
flowise
<= 3.1.1
3.1.2
Связанные уязвимости
Flowise before 3.1.2 contains an information disclosure vulnerability in the /api/v1/chatflows/apikey/:apikey endpoint. When the keyonly query parameter is omitted (the default), the endpoint returns not only the chatflows bound to the supplied API key but also all chatflows across every workspace that have no API key assigned, because the underlying query lacks any workspace filter. An attacker with a valid API key for one workspace can therefore retrieve the full ChatFlow configuration (including flowData with system prompts and node configurations, chatbotConfig, apiConfig, and credential IDs) of unprotected chatflows belonging to other workspaces.