CVE-2026-31950
Unauthorized SSE Stream Access in LibreChat Exposes Chat Data
Publication date: 2026-03-27
Last updated on: 2026-03-30
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| librechat | librechat | 0.8.2 |
| librechat | librechat | 0.8.2 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-284 | The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. |
| CWE-639 | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. |
Attack-Flow Graph
AI Powered Q&A
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
This vulnerability allows unauthorized users to access real-time chat content of other users, including sensitive information such as API keys, passwords, personal identifiable information (PII), and business secrets.
Such unauthorized disclosure of sensitive and personal data can lead to non-compliance with data protection regulations and standards like GDPR and HIPAA, which require strict controls on access to personal and sensitive information.
Because the attack is silent and invisible to victims, it increases the risk of undetected data breaches, further complicating compliance efforts and potentially leading to legal and financial consequences.
Can you explain this vulnerability to me?
CVE-2026-31950 is an Insecure Direct Object Reference (IDOR) vulnerability in LibreChat versions 0.8.2-rc2 and 0.8.2-rc3 affecting the Server-Sent Events (SSE) streaming endpoint `/api/agents/chat/stream/:streamId`.
The vulnerability exists because the endpoint does not verify that the authenticated user requesting the stream actually owns the associated chat stream. This means any authenticated user who obtains or guesses a valid stream ID can subscribe to and read another user's real-time chat content.
The exposed content includes messages, AI-generated responses, and tool invocation data. The stream ID is a cryptographically secure random UUID, making brute forcing difficult, but stream IDs can be leaked through secondary channels like shared URLs, logs, or browser history.
The issue was patched in LibreChat version 0.8.2 by adding ownership verification on the streaming endpoint to ensure only the stream owner can subscribe.
How can this vulnerability impact me? :
This vulnerability can lead to a confidentiality breach where an attacker can silently eavesdrop on another user's real-time chat sessions.
- Unauthorized access to private conversations including messages and AI responses.
- Exposure of sensitive data such as API keys, passwords, personally identifiable information (PII), and business secrets.
- Visibility into agent tool executions performed on behalf of users.
The attack is silent and invisible to the victim, meaning users are unaware their chat content is being accessed by others.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves unauthorized access to the SSE streaming endpoint `/api/agents/chat/stream/:streamId` by authenticated users who do not own the stream. Detection involves monitoring access logs and network traffic for suspicious subscriptions to this endpoint using stream IDs that do not belong to the authenticated user.
Since the stream IDs are cryptographically secure UUIDs, brute forcing is infeasible, so detection should focus on identifying unusual or unauthorized stream ID usage patterns.
- Check server access logs for requests to `/api/agents/chat/stream/:streamId` and verify if the requesting user owns the stream ID.
- Use network monitoring tools (e.g., tcpdump, Wireshark) to capture SSE traffic and analyze if any authenticated user is subscribing to streams they do not own.
- Example command to check logs for stream access: `grep "/api/agents/chat/stream/" /var/log/librechat/access.log | awk '{print $remote_user, $request_uri}'` and then verify ownership of each stream ID.
- Use application-level logging or add custom logging to the endpoint to log user IDs and stream IDs on each subscription request for auditing.
What immediate steps should I take to mitigate this vulnerability?
The primary mitigation is to upgrade LibreChat to version 0.8.2 or later, where the vulnerability is patched by adding ownership verification on the SSE streaming endpoint.
- Upgrade LibreChat to version 0.8.2 or newer.
- Restrict access to the `/api/agents/chat/stream/:streamId` endpoint to ensure only the stream owner can subscribe.
- Audit and rotate any potentially exposed sensitive data such as API keys or passwords that may have been leaked due to this vulnerability.
- Implement monitoring and alerting for unusual access patterns to the streaming endpoint.
- Educate users to avoid sharing stream IDs and secure any secondary channels that might leak stream IDs (e.g., logs, URLs, browser history).