Retrieval Without Access Control
The assistant retrieves documents for its answers without applying the requesting user's permissions, so users can obtain content they are not authorised to see.
| Severity | Medium |
| CVSS 3.1 | 6.5 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N Open in the calculator |
| CVSS 4.0 | 7.1 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1230: Exposure of Sensitive Information Through Metadata |
| MITRE ATT&CK | T1213 Data from Information Repositories |
| Category | Broken Access Control |
Description
Retrieval-augmented generation (RAG) lets a large language model (LLM) answer from an organisation's own content: documents are split into chunks, converted into embeddings and stored in a vector database or search index, and the chunks most similar to a question are retrieved and placed into the prompt. The weakness arises when retrieval does not apply the permissions of the user asking. Content is often ingested with a service account that can read everything, the source system's access controls are not carried into the index, and every query searches the whole index, so the assistant quotes or summarises documents the user could not open directly.
Any user of the assistant can then obtain information from every document in the index by asking the right questions, which may include human resources records, financial results, legal advice or customer data. The attacker needs only an ordinary account, and the assistant's ability to search and summarise makes sensitive material easy to find. The impact depends on what has been indexed, and is greatest where whole file shares, mailboxes or intranet sites were added without review; exposure of personal data may need to be handled as a personal data breach.
Variants include an index shared between customers of a multi-tenant service without a tenant filter, which exposes other customers' content; filters built from values the client supplies, such as a tenant or user identifier in the request; permissions captured once at ingestion and never updated when access is removed; and documents deleted at source that remain in the index.
The weakness is confirmed with two accounts of different access, by asking the assistant about content only the more privileged account may see, for example using a distinctive phrase from a restricted document, and checking both the answer and the citations or retrieved chunks the API returns, which often contain more than the answer shows. Testing should also alter any filter values sent by the client.
Remediation
Make retrieval return only what the requesting user is entitled to see, enforced in the retrieval layer rather than by the model:
- Store access control information with every chunk at ingestion, such as the permitted users or groups and the tenant, taken from the source system.
- Filter every retrieval query by the authenticated user's identity and group memberships, resolved on the server from the session, so that unauthorised chunks are never retrieved. Never take filter values from the request, and never rely on filtering the model's answer afterwards.
- In multi-tenant services, use a separate index or namespace per tenant, or a mandatory tenant filter applied in the data access layer.
- Synchronise permission changes and deletions from the source systems promptly, and re-check access against the source at query time where it supports this.
- Where possible, search through the source system's own search interface with the user's delegated token, so that its permission checks apply.
- Review what is indexed, and exclude repositories whose content should not be available through the assistant.
Confirm the fix by repeating the two-account tests, including with altered client-supplied filters, and checking that restricted content appears in neither the answer nor the retrieved sources.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.