Summary
FastGPT's chat record quote endpoint performs authentication on chat and collection identifiers but fails to bind a key lookup to the same authorized context.
A low-privileged tenant user can supply a foreign dataset data ID and receive another tenant's quote or full-text content, exposing cross-tenant data whenever this endpoint is reachable.
Affected context
This vulnerability occurs in multi-tenant FastGPT deployments using versions 4.14.17 through 4.15.0-beta4 where the /api/core/chat/record/getCollectionQuote endpoint is exposed.
It manifests when the application validates ownership of parameters such as appId, chatId, chatItemDataId, and collectionId, but does not constrain the initialId lookup to the same tenant or dataset context.
In environments where tenants import proprietary or sensitive knowledge-base content, this missing binding can allow one tenant to retrieve content belonging to another tenant via the affected endpoint.
Exploit preconditions
- Attack surface: HTTP POST requests to
/api/core/chat/record/getCollectionQuote. - Required access: Valid low-privileged tenant account capable of invoking the endpoint with legitimate
appId,chatId,chatItemDataId, andcollectionIdvalues. - Trigger point: Supplying an
initialIdthat corresponds to a dataset data record owned by a different tenant while keeping other parameters attacker-owned and valid. - Why exploitation is possible: The server checks that some identifiers belong to the caller, but the
initialIdcenter-node lookup is not enforced against the authenticated tenant or authorized dataset context, enabling retrieval of foreign content.
Why this happens
The underlying bug is an authorization logic flaw where object-level access control is incompletely enforced.
The endpoint correctly validates a subset of resource identifiers (chat and collection context) but treats initialId as a trusted key without re-validating its tenancy or dataset association.
This maps to CWE-863: Incorrect Authorization, where a system authorizes a request based on partial context and fails to ensure that every referenced resource is within the caller's allowed scope.
Potential impact
- Unauthorized retrieval of quotes from another tenant's datasets.
- Exposure of full-text knowledge-base content belonging to other organizations.
- Leakage of proprietary, confidential, or regulated information stored in FastGPT.
- Potential correlation of cross-tenant data leading to broader privacy violations.
General mitigation guidance
Mitigation focuses on enforcing strict, context-aware authorization for every resource identifier processed by the endpoint.
Common defensive patterns include:
- Binding all lookup keys (including
initialId) to the authenticated tenant and verifying they belong to the authorized app, chat, collection, or dataset before use. - Implementing consistent object-level access control checks that treat every parameter referencing stored content as untrusted until validated.
- Designing multi-tenant APIs so that tenant context is derived from authentication and not overridable via request parameters.
- Applying least-privilege principles to data access, ensuring endpoints only expose content that is necessary for the caller's workflow.
How teams detect issues like this
Detection typically involves scrutinizing authorization logic at the resource level rather than just the endpoint level.
Helpful approaches include:
- Static or manual code review to identify endpoints where some parameters are validated for ownership or tenancy while others are used directly in data lookups.
- Authorization-focused tests that attempt cross-tenant access by mixing attacker-owned identifiers with foreign resource IDs to confirm isolation.
- Centralized authorization policies or middleware that enforce tenant binding for all data access operations, backed by automated checks in CI pipelines.
- Use of automated security testing tools capable of generating multi-parameter requests to detect insecure direct object references and incorrect authorization flows.

