/

CVE-2025-69220

Severity:

HIGH RISK

(7.1)

Improper Access Control in LibreChat

CVE-2025-69220

Analyzed

Vulnerability type

Category:

Improper Access Control

CWE:

CWE-284, CWE-862

Impact:

Unauthorized Modification of AI Agent Behavior and Data Context

Severity:

HIGH RISK

(7.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

LibreChat 0.8.1-rc2 exposes improper access control on file uploads tied to agent contexts and file search, allowing authenticated users to influence agents they do not own.

If an attacker knows or can obtain an agent ID, they can upload files into that agent's file context or search index and thereby change the agent's behavior without having direct permissions on that agent.

Affected context

This vulnerability affects LibreChat instances where multiple users share a deployment and use agents with file-backed contexts or file search capabilities.

The issue arises when access control checks for file uploads are tied only to authentication and knowledge of an agent ID, rather than verifying ownership or explicit permissions for that specific agent.

In such setups, any authenticated user who can guess, enumerate, or otherwise obtain an agent ID may be able to upload files into that agent's context and indirectly influence its outputs.

Exploit preconditions

  • Attack surface: Web/API endpoints handling file uploads for agent file contexts and file search.
  • Required access: Valid authenticated LibreChat account on the target deployment.
  • Additional knowledge: The target agent's identifier (ID) or a way to discover it (e.g., through UI visibility, API responses, or guessable IDs).
  • Trigger point: Submitting a file upload request that references an agent ID the attacker does not control.
  • Why exploitation is possible: The backend permits file uploads based on authentication and agent ID alone, without enforcing fine-grained authorization to confirm that the acting user is allowed to modify that specific agent's context.

Why this happens

The core issue is missing or insufficient authorization checks on operations that modify an agent's file context and file search index.

While the application authenticates users, it fails to consistently verify that the requesting user has the right to alter a given agent, mapping to CWE-284: Improper Access Control and CWE-862: Missing Authorization.

At a design level, the system treats knowledge of an agent ID as a de facto permission, rather than enforcing a clear ownership or role-based permission model before accepting file uploads that affect agent behavior.

Potential impact

  • Unauthorized modification of another user's or team's agent behavior by injecting new files into its context.
  • Data poisoning of AI agents, leading to misleading, biased, or harmful responses.
  • Indirect access to sensitive operational patterns or workflows by manipulating agents that drive automation.
  • Reputational damage if agents controlled by one tenant are corrupted by another tenant's uploads in multi-user or multi-tenant deployments.
  • Increased risk of follow-on social engineering or data exfiltration if compromised agents are used to interact with end users.

General mitigation guidance

Effective mitigation focuses on enforcing strict, per-agent authorization and strengthening the trust boundary around file-based context:

  • Introduce explicit ownership and permission models for agents, ensuring only authorized users or roles can modify an agent's file context or file search.
  • Apply server-side authorization checks on every file upload endpoint, validating that the caller is allowed to act on the referenced agent ID.
  • Treat agent identifiers as non-authoritative: do not grant access based solely on the presence of an ID in a request.
  • Segment tenants logically so that agents and their file contexts are scoped to specific users, groups, or organizations, minimizing cross-tenant impact.
  • Use least-privilege defaults: new agents should be private or minimally shared until explicitly configured otherwise.
  • Log and monitor file upload actions per agent, so unauthorized or anomalous changes can be detected and rolled back where feasible.

How teams detect issues like this

Detection efforts can combine code-level and operational approaches:

  • Static analysis & code review:
  • Look for handlers that accept an agent_id parameter for file uploads or search indexing without accompanying authorization checks.
  • Flag API endpoints where authentication is performed but there are no checks to confirm ownership, role, or permission scopes on the agent resource.
  • Review access control middleware usage to ensure it is consistently applied to file-related routes and controllers.
  • Policy & configuration review:
  • Define and enforce policies requiring resource-level authorization (e.g., per-agent access rules) for all state-changing operations.
  • Use security checklists in pull requests to confirm that new endpoints touching agents or files are covered by authorization logic.
  • Runtime monitoring:
  • Log agent ID, acting user ID, and action type (e.g., file upload) and set alerts for suspicious patterns such as a single user modifying many agents.
  • Periodically audit logs for uploads to agents owned by different users or organizations to spot cross-boundary access.
  • Automated security testing tools or SAST/DAST platforms can be configured to identify endpoints that rely on weak or missing authorization around resource identifiers.

Sources

SourceLink
cwe.mitre.orgcwe.mitre.org/data/definitions/284.html
cwe.mitre.orgcwe.mitre.org/data/definitions/862.html
github.comgithub.com/danny-avila/LibreChat/commit/4b9c6ab1cb9de626736de700c7981f38be08d237
github.comgithub.com/danny-avila/LibreChat/releases/tag/v0.8.2-rc2
github.comgithub.com/danny-avila/LibreChat/security/advisories/GHSA-xcmf-rpmh-hg59
owasp.orgowasp.org/Top10/A01_2021-Broken_Access_Control
owasp.orgowasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/05-Authorization_Testing/02-Testing_for_Bypassing_Authorization_Schema.html
raw.githubusercontent.comraw.githubusercontent.com/OWASP/ASVS/v5.0.0/5.0/OWASP_Application_Security_Verification_Standard_5.0.0_en.pdf

Frequently asked

questions

Exploitation is limited to authenticated users of the affected LibreChat instance, but within that scope, any user who can obtain a target agent's ID may be able to manipulate that agent's file context and behavior, especially in shared or multi-user environments.

No elevated privileges are inherently required; a regular authenticated account is sufficient if the attacker can reference the target agent ID. The flaw lies in missing authorization checks, not in bypassing authentication.

Implement strict, server-side authorization for every operation that modifies an agent, especially file uploads and search indexing. Each request should verify that the acting user has explicit rights (ownership, role, or ACL entry) to change the referenced agent's resources, rather than trusting the presence of an agent ID.

Adopt a resource-centric access control model where every state-changing API validates permissions on the specific resource, enforce consistent use of authorization middleware, and include access control checks as a mandatory part of design reviews and automated tests, particularly for multi-user or multi-tenant AI platforms.

Find out what's already
exploitable in your codebase.