CVE-2026-34371

LibreChat Affected by Arbitrary File Write via `execute_code` Artifact Filename Traversal

Published Apr 7, 2026 CVSS 3.1 · 6.3 Medium EPSS < 1% KEV · Not listed
Description
LibreChat is a ChatGPT clone with additional features. Prior to 0.8.4, LibreChat trusts the name field returned by the execute_code sandbox when persisting code-generated artifacts. On deployments using the default local file strategy, a malicious artifact filename containing traversal sequences (for example, ../../../../../app/client/dist/poc.txt) is concatenated into the server-side destination path and written with fs.writeFileSync() without sanitization. This gives any user who can trigger execute_code an arbitrary file write primitive as the LibreChat server user. This vulnerability is fixed in 0.8.4.

Analysis

AI-generated

Technical impact

LibreChat, a ChatGPT clone developed by danny‑avila, allows an attacker to write arbitrary files through the execute_code sandbox. The vulnerability originates from the unsanitized artifact filename supplied by the sandbox when generating code artifacts. When a malicious filename includes directory traversal sequences, the server concatenates it to the local file path and writes the file using fs.writeFileSync. This flaw falls under CWE‑22 and grants an attacker the ability to create or overwrite files as the LibreChat server user, potentially compromising configuration or injecting malicious code.

Affected Systems

Any deployment of LibreChat prior to version 0.8.4 that uses the default local file strategy is impacted. The vulnerability affects the product named LibreChat from the vendor danny‑avila. No additional product versions are specified beyond the 0.8.4 threshold.

Risk and Exploitability

The CVSS score of 6.3 indicates moderate severity, while an EPSS score below 1% suggests a low likelihood of active exploitation. The vulnerability is not listed in CISA’s KEV catalog. The attack vector is inferred to be remote, relying on the ability to trigger the execute_code feature – presumably by providing executable code that returns a crafted filename. Once triggered, the attacker can write any file within the server’s writable directories, which is a critical privilege escalation risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade LibreChat to version 0.8.4 or later.
  • If an upgrade is not possible, disable the execute_code endpoint or remove the ability for users to specify custom artifact filenames.
  • Restrict the file system permissions of the LibreChat process to limit writable locations.
  • Implement monitoring for unexpected file creation or overwrites in the application directories.

Generated by OpenCVE AI on April 14, 2026 at 21:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Librechat
Librechat librechat
CPEs cpe:2.3:a:librechat:librechat:*:*:*:*:*:*:*:*
Vendors & Products Librechat
Librechat librechat
Type Values Removed Values Added
First Time appeared Danny-avila
Danny-avila libre Chat
Vendors & Products Danny-avila
Danny-avila libre Chat
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description LibreChat is a ChatGPT clone with additional features. Prior to 0.8.4, LibreChat trusts the name field returned by the execute_code sandbox when persisting code-generated artifacts. On deployments using the default local file strategy, a malicious artifact filename containing traversal sequences (for example, ../../../../../app/client/dist/poc.txt) is concatenated into the server-side destination path and written with fs.writeFileSync() without sanitization. This gives any user who can trigger execute_code an arbitrary file write primitive as the LibreChat server user. This vulnerability is fixed in 0.8.4.
Title LibreChat Affected by Arbitrary File Write via `execute_code` Artifact Filename Traversal
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:N/I:H/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Apr 8, 2026, 4:14 PM
Reserved
Mar 27, 2026, 1:43 PM
Status
Analyzed
Published
Apr 7, 2026, 10:16 PM
Modified
Jul 24, 2026, 10:10 PM