CVE-2026-54025: LibreChat: Stored XSS via unescaped image alt text in markdown artifact preview
LibreChat is an enhanced ChatGPT clone that supports multiple AI providers. Prior to 0.8.4-rc1, there is a vulnerability in LibreChat's markdown artifact preview pipeline. The marked library v15.0.12 does not HTML-escape double-quote characters in image alt text when a custom renderer falls through to the default renderer. LibreChat's generateMarkdownHtml function (in client/src/utils/markdown.ts) installs a custom image renderer that returns false for URLs passing the isSafeUrl allowlist check, which causes marked to fall back to its built-in renderer. That built-in renderer inserts the raw alt text into the alt="..." attribute without escaping double-quote characters. An attacker can craft an alt text such as " onload="payload to break out of the attribute and inject an arbitrary event handler. The resulting HTML is then assigned to document.getElementById('content').innerHTML inside the Sandpack preview iframe, causing the payload to execute in the victim's browser. This vulnerability is fixed in 0.8.4-rc1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
LibreChatto a version that resolves this vulnerability.Fixed in 0.8.4-rc1
Event History
Frequently Asked Questions
What is the severity of CVE-2026-54025?
The severity of CVE-2026-54025 is medium with a score of 5.4 according to the CVSS v3.1 metrics.
How do I fix CVE-2026-54025?
To fix CVE-2026-54025, upgrade LibreChat to version 0.8.4-rc1 or later, where the vulnerability has been addressed.
What type of vulnerability is CVE-2026-54025?
CVE-2026-54025 is classified as a Stored XSS (Cross-Site Scripting) vulnerability.
What impact does CVE-2026-54025 have on users?
CVE-2026-54025 could allow an attacker to execute arbitrary JavaScript in the context of the user's session through unescaped image alt text.
Who is affected by CVE-2026-54025?
Users of LibreChat versions prior to 0.8.4-rc1 are affected by CVE-2026-54025.