CVE-2026-54032 in LibreChatinfo

Summary

by MITRE • 11/20/2026

LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.6, client/src/components/Chat/Input/MCPConfigDialog.tsx renders the remote MCP details.description value through dangerouslySetInnerHTML without sanitization, allowing a malicious MCP server to execute script when a user opens the configuration dialog. The secondary client/src/components/Banners/Banner.tsx sink similarly renders administrator-controlled banner.message HTML without sanitization for all users. Script execution occurs in the LibreChat browser origin and can expose browser-context data or alter displayed content. This issue is fixed in version 0.8.6.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 11/20/2026

The vulnerability identified in LibreChat versions prior to 0.8.6 represents a critical Cross-Site Scripting (XSS) flaw rooted in the improper handling of untrusted input within client-side React components. Specifically, two distinct sinks were affected: the MCPConfigDialog component located at src/components/Chat/Input/MCPConfigDialog.tsx and the Banner component at src/components/Banners/Banner.tsx. Both components utilized the dangerouslySetInnerHTML property to render HTML content directly into the DOM without applying any sanitization or encoding mechanisms. This architectural decision bypasses React's default XSS protections, which typically escape text nodes by converting special characters like angle brackets and quotes into their corresponding HTML entities. By opting for direct HTML injection, the application effectively trusts raw input from external sources as safe executable code, creating a significant attack surface for malicious actors.

The first vector involves the MCPConfigDialog component, which renders the description field provided by remote Model Context Protocol (MCP) servers. Since LibreChat allows users to connect to various AI providers and configure their settings through this dialog, any data returned from an MCP server is displayed within this interface. An attacker controlling a malicious MCP server can craft a response where the description field contains embedded JavaScript payloads. When a user opens the configuration dialog for that specific provider, the browser parses and executes the injected script in the context of the LibreChat origin. This execution occurs with the same privileges as legitimate application code, allowing the attacker to interact with the page's Document Object Model (DOM), access local storage cookies, or perform actions on behalf of the authenticated user without their knowledge.

The second vector pertains to the Banner component, which is responsible for displaying administrative messages to all users within the platform. In this scenario, an administrator or a compromised account with banner management privileges can inject arbitrary HTML and JavaScript into the message field. Because this content is rendered via dangerouslySetInnerHTML without sanitization, every user who views the application will have their browser execute the malicious script upon loading the page. This secondary vector is particularly dangerous because it does not require active configuration changes by individual users; instead, it affects all visitors to the platform simultaneously. The impact here includes widespread credential theft, session hijacking, or defacement of the user interface, as the attacker gains full control over the client-side execution environment for every affected user.

From a classification perspective, this vulnerability aligns with CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as Cross-Site Scripting (XSS). The specific mechanism falls under CWE-80 and CWE-83 variants where dynamic content is inserted into the DOM without proper validation. In terms of offensive security frameworks, this behavior maps to MITRE ATT&CK technique T1059.007: JavaScript, which describes how attackers use client-side scripts to execute malicious actions within a victim's browser context. The exploitation relies on the attacker injecting code that is then executed by the victim's browser, leveraging the trust relationship between the user and the LibreChat application domain.

The operational impact of these vulnerabilities extends beyond simple script execution. Attackers can exfiltrate sensitive data such as authentication tokens, API keys stored in local storage, or personal information displayed within the chat interface. Furthermore, they can manipulate the visual presentation of the application to facilitate phishing attacks, tricking users into revealing credentials on a fake login page rendered via DOM manipulation. The ability to alter content dynamically also allows for persistent defacement or redirection to malicious external sites, undermining the integrity and trustworthiness of the LibreChat platform. Given that LibreChat serves as an interface for AI interactions, compromising this layer could potentially lead to further exploitation if the injected scripts interact with API endpoints or manipulate prompts sent to backend models.

Mitigation strategies must focus on eliminating the use of dangerouslySetInnerHTML for any content derived from external sources or user input. The primary remediation implemented in version 0.8.6 involves replacing direct HTML injection with safe rendering practices, such as using React's standard JSX text interpolation for plain strings or employing a robust sanitization library like DOMPurify to clean HTML before insertion. For the MCP configuration dialog, developers should sanitize the description field received from remote servers before passing it to any component that renders HTML. Similarly, banner messages controlled by administrators must be validated and sanitized on both the client and server sides to ensure no executable scripts are present in the final output.

In addition to code-level fixes, architectural changes can enhance security posture. Implementing a Content Security Policy (CSP) with strict directives regarding script sources can mitigate the impact of any future XSS vulnerabilities by preventing unauthorized inline scripts from executing. This defense-in-depth approach ensures that even if an injection occurs, the browser will block its execution unless it originates from a trusted domain explicitly listed in the policy. Regular security audits and static analysis tools should be integrated into the development pipeline to detect instances of dangerouslySetInnerHTML usage early. Developers must remain vigilant about data flow, ensuring that all user-controlled or externally-sourced data is treated as untrusted until properly sanitized. The release of version 0.8.6 addresses these specific sinks, but ongoing vigilance and adherence to secure coding standards are essential to prevent similar vulnerabilities in other parts of the application ecosystem.

Responsible

GitHub M

Reservation

06/11/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!