CVE-2026-54025
JSON

5.4medium

LibreChat: Stored XSS via unescaped image alt text in markdown artifact preview

Severity
5.4medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.16% (higher than 5% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

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

Product or packageVersionsReported by
danny-avila LibreChat< 0.8.4-rc1CVE List
librechat librechatup to 0.7.8NVD

Classification

CWE-79

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

LibreChat es un clon mejorado de ChatGPT que soporta múltiples proveedores de IA. Antes de 0.8.4-rc1, existe una vulnerabilidad en la canalización de vista previa de artefactos markdown de LibreChat. La biblioteca marked v15.0.12 no escapa en HTML los caracteres de comillas dobles en el texto alternativo de la imagen cuando un renderizador personalizado recurre al renderizador predeterminado. La función generateMarkdownHtml de LibreChat (en client/src/utils/markdown.ts) instala un renderizador de imágenes personalizado que devuelve falso para las URL que pasan la verificación de la lista de permitidos isSafeUrl, lo que hace que marked recurra a su renderizador incorporado. Ese renderizador incorporado inserta el texto alternativo sin procesar en el atributo alt=’...’ sin escapar los caracteres de comillas dobles. Un atacante puede crear un texto alternativo como “ onload_disabled=”payload para salir del atributo e inyectar un gestor de eventos arbitrario. El HTML resultante se asigna luego a document.getElementById(’content’).innerHTML dentro del iframe de vista previa de Sandpack, haciendo que la carga útil se ejecute en el navegador de la víctima. Esta vulnerabilidad está corregida en 0.8.4-rc1.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-54025 changed 2026-06-25CVE Terms of Use
NVDCVE-2026-54025 changed 2026-10-25Public domain