CVE-2026-54025 LibreChat: Stored XSS via unescaped image alt text in markdown artifact preview

Medium 5.4 Published Updated

Attackers can inject malicious scripts via unescaped image alt text in markdown previews, executing code in victim browsers.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-54025?

CVE-2026-54025 is a medium-severity cross-site scripting vulnerability in Librechat Librechat, published on 25 Jun 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-79

Which versions are affected by CVE-2026-54025?

It affects 1 product.

Products include Librechat Librechat.

How do I fix CVE-2026-54025?

No fix has been published for CVE-2026-54025 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-54025 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54025 exists.

All Librechat Librechat vulnerabilities

Sources

Also known as GHSA-3phr-62qf-cxf3.

Is CVE-2026-54025 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free