GHSA-C2C9-MFW7-P8HW
Vulnerability from github – Published: 2026-05-20 15:45 – Updated: 2026-05-20 15:45Summary
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:
const getChatflowByApiKey = async (req: Request, res: Response, next: NextFunction) => {
try {
const apikey = await apiKeyService.getApiKey(req.params.apikey)
if (\!apikey) {
return res.status(401).send("Unauthorized")
}
const apiResponse = await chatflowsService.getChatflowByApiKey(apikey.id, req.query.keyonly)
return res.json(apiResponse) // Returns full chatflow objects with flowData
} catch (error) {
next(error)
}
}
The service at packages/server/src/services/chatflows/index.ts:223-245 builds the database query:
const getChatflowByApiKey = async (apiKeyId: string, keyonly?: unknown): Promise<any> => {
const appServer = getRunningExpressApp()
let query = appServer.AppDataSource.getRepository(ChatFlow)
.createQueryBuilder("cf")
.where("cf.apikeyid = :apikeyid", { apikeyid: apiKeyId })
if (keyonly === undefined) {
// When keyonly is not set (default), also return ALL chatflows with no API key
query = query.orWhere("cf.apikeyid IS NULL").orWhere("cf.apikeyid = ''")
}
const dbResponse = await query.orderBy("cf.name", "ASC").getMany()
return dbResponse // Returns full ChatFlow entities including flowData
}
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 code
- chatbotConfig - chatbot configuration including allowed origins
- apiConfig - API configuration and override settings
- textToSpeech / speechToText - TTS/STT configuration including credential IDs
- analytic - analytics configuration
PoC
# Step 1: Attacker has a valid API key for Workspace A
API_KEY="<attacker-workspace-a-api-key>"
# Step 2: Query the chatflows/apikey endpoint WITHOUT keyonly parameter
# Returns the attacker chatflows PLUS all chatflows without API keys from ALL workspaces
curl -s "http://localhost:3000/api/v1/chatflows/apikey/" | jq ".[].workspaceId"
# Step 3: With keyonly parameter, only chatflows bound to the API key are returned
curl -s "http://localhost:3000/api/v1/chatflows/apikey/?keyonly=true" | jq ".[].workspaceId"
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:
// packages/server/src/services/chatflows/index.ts
const getChatflowByApiKey = async (apiKeyId: string, keyonly?: unknown, workspaceId?: string): Promise<any> => {
const appServer = getRunningExpressApp()
let query = appServer.AppDataSource.getRepository(ChatFlow)
.createQueryBuilder("cf")
.where("cf.apikeyid = :apikeyid", { apikeyid: apiKeyId })
if (keyonly === undefined && workspaceId) {
// Only include unprotected chatflows from the SAME workspace
query = query.orWhere(
"(cf.apikeyid IS NULL OR cf.apikeyid = :empty) AND cf.workspaceId = :workspaceId",
{ empty: "", workspaceId }
)
}
const dbResponse = await query.orderBy("cf.name", "ASC").getMany()
return dbResponse
}
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.1.1"
},
"package": {
"ecosystem": "npm",
"name": "flowise"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-863"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-20T15:45:19Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe `/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.\n\n## Details\n\nThe controller at `packages/server/src/controllers/chatflows/index.ts:90-107` validates the API key and calls the service:\n\n```typescript\nconst getChatflowByApiKey = async (req: Request, res: Response, next: NextFunction) =\u003e {\n try {\n const apikey = await apiKeyService.getApiKey(req.params.apikey)\n if (\\!apikey) {\n return res.status(401).send(\"Unauthorized\")\n }\n const apiResponse = await chatflowsService.getChatflowByApiKey(apikey.id, req.query.keyonly)\n return res.json(apiResponse) // Returns full chatflow objects with flowData\n } catch (error) {\n next(error)\n }\n}\n```\n\nThe service at `packages/server/src/services/chatflows/index.ts:223-245` builds the database query:\n\n```typescript\nconst getChatflowByApiKey = async (apiKeyId: string, keyonly?: unknown): Promise\u003cany\u003e =\u003e {\n const appServer = getRunningExpressApp()\n let query = appServer.AppDataSource.getRepository(ChatFlow)\n .createQueryBuilder(\"cf\")\n .where(\"cf.apikeyid = :apikeyid\", { apikeyid: apiKeyId })\n if (keyonly === undefined) {\n // When keyonly is not set (default), also return ALL chatflows with no API key\n query = query.orWhere(\"cf.apikeyid IS NULL\").orWhere(\"cf.apikeyid = \u0027\u0027\")\n }\n const dbResponse = await query.orderBy(\"cf.name\", \"ASC\").getMany()\n return dbResponse // Returns full ChatFlow entities including flowData\n}\n```\n\nWhen `keyonly` is not provided as a query parameter (which is the default case), the query expands to include:\n- All chatflows bound to the provided API key (same workspace, expected behavior)\n- ALL chatflows with `apikeyid IS NULL` (any workspace, no workspace filter)\n- ALL chatflows with empty `apikeyid` (any workspace, no workspace filter)\n\nThere is NO `workspaceId` filter in this query. The response includes the full `ChatFlow` entity, which contains:\n- `flowData` - the complete workflow graph including system prompts, model names, internal URLs, custom code\n- `chatbotConfig` - chatbot configuration including allowed origins\n- `apiConfig` - API configuration and override settings\n- `textToSpeech` / `speechToText` - TTS/STT configuration including credential IDs\n- `analytic` - analytics configuration\n\n## PoC\n\n```bash\n# Step 1: Attacker has a valid API key for Workspace A\nAPI_KEY=\"\u003cattacker-workspace-a-api-key\u003e\"\n\n# Step 2: Query the chatflows/apikey endpoint WITHOUT keyonly parameter\n# Returns the attacker chatflows PLUS all chatflows without API keys from ALL workspaces\ncurl -s \"http://localhost:3000/api/v1/chatflows/apikey/\" | jq \".[].workspaceId\"\n\n# Step 3: With keyonly parameter, only chatflows bound to the API key are returned\ncurl -s \"http://localhost:3000/api/v1/chatflows/apikey/?keyonly=true\" | jq \".[].workspaceId\"\n```\n\n## Impact\n\n- **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.\n- **Intellectual Property Exposure**: System prompts, custom function code, and workflow architecture of chatflows from other workspaces/organizations are exposed.\n- **Credential Reference Leakage**: The `textToSpeech` and `speechToText` fields include credential IDs, which can be abused via the TTS generate endpoint.\n- **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.\n\n## Recommended Fix\n\nAdd workspace scoping to the `getChatflowByApiKey` query by passing the API key workspace ID and filtering the OR clause:\n\n```typescript\n// packages/server/src/services/chatflows/index.ts\nconst getChatflowByApiKey = async (apiKeyId: string, keyonly?: unknown, workspaceId?: string): Promise\u003cany\u003e =\u003e {\n const appServer = getRunningExpressApp()\n let query = appServer.AppDataSource.getRepository(ChatFlow)\n .createQueryBuilder(\"cf\")\n .where(\"cf.apikeyid = :apikeyid\", { apikeyid: apiKeyId })\n if (keyonly === undefined \u0026\u0026 workspaceId) {\n // Only include unprotected chatflows from the SAME workspace\n query = query.orWhere(\n \"(cf.apikeyid IS NULL OR cf.apikeyid = :empty) AND cf.workspaceId = :workspaceId\",\n { empty: \"\", workspaceId }\n )\n }\n const dbResponse = await query.orderBy(\"cf.name\", \"ASC\").getMany()\n return dbResponse\n}\n```",
"id": "GHSA-c2c9-mfw7-p8hw",
"modified": "2026-05-20T15:45:19Z",
"published": "2026-05-20T15:45:19Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-c2c9-mfw7-p8hw"
},
{
"type": "PACKAGE",
"url": "https://github.com/FlowiseAI/Flowise"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Flowise: Cross-Workspace Chatflow Disclosure via chatflows/apikey Endpoint Returns All Unprotected Chatflows"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.