Summary
A broken access control flaw in FastGPT's multi-tenant API allows any authenticated team to access and execute applications owned by other teams by specifying a different appId.
Because the backend validates only the team token but not application ownership, cross-tenant data exposure and unauthorized execution of private AI workflows can occur whenever a foreign appId is supplied.
Affected context
This vulnerability arises in FastGPT deployments that expose a multi-tenant API where applications (AI workflows) are scoped to teams.
The issue occurs on endpoints that:
- Accept an appId parameter to access or execute an application
- Validate that the caller is an authenticated team
- Do not confirm that the referenced application actually belongs to the requesting team
It is most relevant in environments where multiple organizations or teams share the same FastGPT instance and rely on logical isolation for data and workflow separation.
Exploit preconditions
- Attack surface: HTTP(S) API endpoints used to access or execute FastGPT applications by appId.
- Required access: Any authenticated team account; no special roles or administrative permissions are necessary.
- Trigger point: Supplying an appId that belongs to a different team in requests that read, configure, or execute an application.
- Why exploitation is possible: The authorization logic checks only that the token represents a valid team but does not verify that the target resource (application identified by appId) is owned by that team, resulting in a classic IDOR/BOLA condition.
Why this happens
The core issue is a missing authorization check at the object level for application resources.
While the system enforces authentication and confirms that requests are associated with a team, it fails to enforce object-to-tenant binding, allowing any valid team token to reference arbitrary appId values.
This maps to CWE-639: Authorization Bypass Through User-Controlled Key, and is closely related to CWE-284: Improper Access Control, where resource identifiers controlled by clients are trusted without verifying ownership or tenancy relationships.
Potential impact
- Unauthorized access to other teams' application configurations and metadata
- Cross-tenant exposure of prompts, system instructions, and AI workflow logic
- Access to or inference about other tenants' data processed by those workflows
- Unauthorized execution of private AI workflows under another team's context
- Potential abuse of another tenant's quota, billing, or model usage limits
- Information leakage that may assist further lateral movement or targeted attacks
General mitigation guidance
Effective mitigation focuses on strict object-level authorization and consistent multi-tenant boundaries:
- Enforce ownership checks on every API endpoint that accepts an appId or similar resource identifier, ensuring the resource belongs to the authenticated team.
- Model applications as tenant-scoped entities and require database queries that always include both the team identifier and the app identifier in their filters.
- Avoid trusting client-supplied identifiers alone; derive or validate tenant context server-side before performing read, update, or execute operations.
- Centralize authorization logic in reusable middleware or service components to reduce the chance of missing checks on new endpoints.
- Apply least-privilege principles for API tokens, restricting them to a single tenant and limiting their accessible resource set.
- Incorporate multi-tenant design patterns that treat cross-tenant access as forbidden by default unless explicitly and safely allowed.
How teams detect issues like this
Detection typically combines code-level review with runtime monitoring:
- Static analysis and code review:
- Search for endpoints that accept appId (or similar identifiers) and confirm they join or filter on both team ID and appId at the data access layer.
- Flag data access patterns where resource lookup is done solely by user-controlled identifiers without including tenant or ownership constraints.
- Review controller/service methods for missing authorization decorators or middleware on application-related routes.
- Security testing and QA:
- Perform manual or automated API tests where authenticated users attempt to access resources by guessing or enumerating foreign IDs.
- Validate that all failure cases return consistent "not found" or "forbidden" responses without leaking whether an appId exists for a different tenant.
- Operational monitoring:
- Log appId and teamId on access to application resources and monitor for mismatches or unusual cross-tenant access patterns.
- Use API gateways or policy engines to enforce tenant-scoped access rules and alert on violations.
- Automated SAST/IAST tools can be configured to highlight missing tenant checks or direct lookups by unvalidated resource identifiers.

