/

CVE-2026-40252

Severity:

HIGH RISK

(8.1)

Broken Access Control / IDOR in FastGPT Multi-Tenant

CVE-2026-40252

Analyzed

Vulnerability type

Category:

Broken Access Control / IDOR

CWE:

CWE-284, CWE-639

Impact:

Cross-Tenant Data Exposure and Unauthorized Workflow Execution

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/labring/FastGPT/releases/tag/v4.14.10.4
github.comgithub.com/labring/FastGPT/security/advisories/GHSA-gc8m-w37w-24hw

Frequently asked

questions

Yes. Any remote client that can authenticate as a team and call the affected API endpoints can attempt to exploit the issue by supplying foreign appId values.

No. Regular authenticated team accounts are sufficient, because the flaw lies in missing object-level authorization checks rather than in privileged operations.

The safest pattern is to enforce strict object-level authorization on every access path: for each appId, confirm that the application is owned by the authenticated team before returning data or executing the workflow. This should be implemented in a centralized authorization layer and applied consistently across all relevant endpoints.

Design the system with tenant isolation as a first-class concern: require tenant context for all resource operations, never rely solely on client-supplied identifiers, and incorporate automated tests and code review checklists that verify ownership checks for every resource that is identified by an ID controlled by the client.

Find out what's already
exploitable in your codebase.