Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-11167

CVE-2024-11167: LibreChat Access Control Vulnerability

CVE-2024-11167 is an access control flaw in LibreChat that allows authenticated users to delete other users' prompts without proper authorization. This article covers the technical details, affected versions, and mitigation strategies.

Published:

CVE-2024-11167 Overview

CVE-2024-11167 is an improper access control vulnerability in danny-avila/librechat versions prior to 0.7.6. Authenticated users can delete other users' prompts by supplying an arbitrary groupId parameter to the prompt deletion endpoint. The endpoint does not verify that the referenced prompt belongs to the requesting user before executing the delete operation. This weakness is classified under CWE-639: Authorization Bypass Through User-Controlled Key, commonly known as Insecure Direct Object Reference (IDOR).

Critical Impact

Any authenticated LibreChat user can destroy prompt groups owned by other users, resulting in loss of integrity for shared prompt libraries and disruption of user workflows.

Affected Products

  • LibreChat versions prior to 0.7.6
  • Self-hosted danny-avila/librechat deployments
  • Multi-tenant LibreChat instances exposing prompt group functionality

Discovery Timeline

  • 2025-03-20 - CVE-2024-11167 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-11167

Vulnerability Analysis

The vulnerability resides in the prompt group deletion route within api/server/routes/prompts.js. The handler builds a MongoDB query using the promptId and groupId values supplied in the request, alongside the current user's id and role. Because the role field was included in the base query object, the intended ownership check on author was bypassed for non-admin users under specific role conditions. As a result, an authenticated user could pass a groupId belonging to another user and trigger deletion of that resource.

The fix restructures the query to enforce author scoping by default and removes the role field from the match criteria. Admin users continue to have unrestricted deletion capability, which the patch preserves by deleting the author filter only when req.user.role === SystemRoles.ADMIN.

Root Cause

The root cause is missing per-object authorization on the delete endpoint. The server trusted the client-supplied groupId and promptId values without confirming that the target prompt group's author matched the authenticated user. Access control was expressed through query construction rather than a discrete authorization check, leaving the door open to IDOR abuse.

Attack Vector

Exploitation requires an authenticated session against the LibreChat API. The attacker sends a DELETE request to the prompt endpoint and supplies a groupId that identifies a prompt group owned by another user. No user interaction is required from the victim, and no elevated privileges are needed beyond a standard account.

javascript
// Security patch in api/server/routes/prompts.js
// fix: invalid access control for deleting prompt groups
    const { promptId } = req.params;
    const { groupId } = req.query;
    const author = req.user.id;
-    const query = { promptId, groupId, author, role: req.user.role };
+    const query = { promptId, groupId, author };
    if (req.user.role === SystemRoles.ADMIN) {
      delete query.author;
    }

Source: GitHub commit 5071bdb

Detection Methods for CVE-2024-11167

Indicators of Compromise

  • Unexpected deletion of prompt groups reported by users who did not initiate the action.
  • API access logs showing DELETE requests to /api/prompts/:promptId with groupId values that do not correspond to prompt groups owned by the requesting user.
  • Spikes in prompt deletion activity from a single authenticated user identifier.

Detection Strategies

  • Correlate the authenticated user ID of DELETE requests against the author field of the deleted prompt group in application audit logs.
  • Alert on any prompt deletion where the requesting user is not an admin and is not the author of the resource.
  • Baseline normal deletion volume per user and flag statistical anomalies.

Monitoring Recommendations

  • Enable verbose audit logging for all prompt group create, update, and delete operations in LibreChat.
  • Forward LibreChat application logs to a central SIEM for cross-user correlation.
  • Track failed and successful admin role checks on prompt routes to identify probing behavior.

How to Mitigate CVE-2024-11167

Immediate Actions Required

  • Upgrade LibreChat to version 0.7.6 or later, which contains the fix in commit 5071bdb.
  • Audit existing prompt groups to identify unauthorized deletions since deployment.
  • Rotate API tokens and session credentials if abuse is suspected.
  • Restrict LibreChat access to trusted, authenticated users while patching is in progress.

Patch Information

The vendor addressed the issue in the LibreChat security commit 5071bdb. The patch removes the role field from the deletion query and enforces author scoping for non-admin users. Additional context is available in the Huntr bounty submission.

Workarounds

  • Place LibreChat behind an authenticating reverse proxy that restricts prompt endpoints to a limited user population until the patch is applied.
  • Temporarily disable the prompt group feature for non-admin users where feasible.
  • Back up prompt data on a frequent schedule to enable recovery from unauthorized deletions.
bash
# Upgrade LibreChat to a patched release
git fetch --tags
git checkout v0.7.6
npm ci
npm run build
# Restart the LibreChat service after upgrade

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.