Summary
Cognee contains a broken access control flaw that lets any self-registered user modify the global LLM provider configuration without admin checks.
When exploited, all instance-wide LLM traffic can be redirected to an attacker-controlled endpoint, exposing prompts, uploaded documents, and knowledge graph data from other users.
Affected context
This vulnerability occurs in Cognee deployments where:
- User self-registration is enabled or possible
- The settings endpoint is exposed to authenticated users without role checks
- A process-wide singleton cache stores the global LLM provider configuration
Under these conditions, any non-privileged user who can reach the settings API may overwrite the shared configuration, affecting all users in that instance.
Exploit preconditions
- Attack surface: HTTP API settings endpoint used to manage LLM provider configuration
- Required access: Ability to create a standard user account via self-registration and send authenticated requests to the settings endpoint
- Trigger point: Calling the configuration update operation on the settings endpoint, which lacks admin or superuser authorization checks
- Why exploitation is possible: The endpoint trusts any authenticated user and writes directly to a process-wide singleton configuration cache, so changes instantly affect all LLM operations across the instance
Why this happens
The underlying bug is a classic broken access control issue mapped to CWE-306 (Missing Authentication for Critical Resource) and CWE-862 (Missing Authorization).
A security-sensitive operation—editing global LLM provider settings—is exposed via an API that performs no role-based authorization or privilege check beyond basic authentication.
Because the application stores LLM configuration in a shared singleton cache, there is no per-tenant isolation; a single unauthorized write modifies behavior for all users, enabling redirection of model traffic and unintended disclosure of user data flowing through the LLM.
Potential impact
- Attackers may redirect all LLM requests to an attacker-controlled endpoint
- Attackers can exfiltrate prompts, uploaded documents, extracted entities, and knowledge graph content from all users
- Attackers could tamper with LLM responses, leading to data poisoning or misinformation
- Attackers may disrupt service availability by pointing the LLM provider configuration to invalid or unstable endpoints
- Attackers can degrade user trust by silently observing or manipulating sensitive workloads processed by the LLM
General mitigation guidance
Effective mitigation focuses on enforcing strict access control around global configuration and reducing the blast radius of misconfiguration.
Common defensive patterns include:
- Treating configuration management endpoints as privileged operations, guarded by explicit admin or superuser role checks
- Applying role-based access control (RBAC) and least privilege, so standard users cannot modify instance-wide settings
- Introducing configuration scoping or tenant isolation instead of process-wide singletons for multi-user environments
- Validating configuration changes through server-side policies (e.g., allowlisted provider domains, transport security requirements)
- Logging and monitoring configuration changes, with alerting on unexpected or non-admin modifications
How teams detect issues like this
Organizations can detect similar broken access control issues by:
- Performing static analysis focused on endpoints that write to configuration objects, checking for missing authorization gates or role checks
- Reviewing API controllers and service layers for operations that modify global or shared state without explicit privilege verification
- Enforcing architectural policies that require security annotations or middleware for administrative functionality
- Using automated security testing tools (DAST/SAST) and authorization-focused test cases to simulate low-privilege attempts to change settings
- Auditing runtime logs for configuration changes initiated by non-admin accounts or unusual traffic patterns to new LLM endpoints

