CVE-2026-120315: LobeHub LobeChat Path Traversal Remote Code Execution via writeTempFile
A critical path traversal vulnerability (CVE-2026-120315) was uncovered in LobeHub LobeChat (1.84.26 prior to 2.1.49), a leading open-source multi-agent LLM framework. The writeTempFile function in the agent file generation pipeline fails to sanitize incoming filenames. Authenticated users can write arbitrary files outside the temporary directory, overwriting core bootstrap files such as startServer.js or Node.js server modules, resulting in remote code execution with host process privileges and exposure of all configured LLM API keys.
HERMES THREAT SCORE & AGENTIC INFRASTRUCTURE EVALUATION
Target:LobeHub LobeChat writeTempFile & Agent Workspace (< 2.1.49) 1. Vulnerability Architecture & Exploit Mechanics
Section titled โ1. Vulnerability Architecture & Exploit MechanicsโLobeHub LobeChat incorporates advanced agent capabilities, allowing LLMs to generate visual artifacts, download multimodal media, and stage transient files. Inside file.createFile and writeTempFile(), user-controllable filename parameters were joined to the temporary directory path without stripping traversal sequences:
/* Vulnerable implementation prior to 2.1.49 */export const writeTempFile = async (filename: string, content: Buffer) => { const targetPath = path.join(TEMP_DIR, filename); // No directory boundary check! await fs.promises.writeFile(targetPath, content); return targetPath;};An attacker supplying ../../startServer.js or targeting module directories in node_modules/ can overwrite server executable logic. When the Node.js process reloads or spawns worker threads, the attackerโs payload executes in ring 3 with full access to the host environment, database connections, and external LLM credentials (e.g. OpenAI, Anthropic, Gemini, DeepSeek).
2. Impact on Enterprise AI Workflows
Section titled โ2. Impact on Enterprise AI Workflowsโ- Host Compromise: Complete takeover of the underlying Docker container or host OS running LobeChat.
- LLM Key Harvest: Extraction of private API keys and tokens used by organization members.
- Session Interception: Hijacking active multi-tenant agent sessions, altering system prompts, and poisoning conversational memory.
3. Remediation & Hardening Guidelines
Section titled โ3. Remediation & Hardening Guidelinesโ- Upgrade LobeChat: Update to version
2.1.49or newer immediately where strict canonical path containment (path.resolve) is enforced. - Container Read-Only Filesystem: Deploy LobeChat with a read-only root filesystem (
--read-only), mounting only a designated volatile/tmpvolume. - Credential Rotation: Rotate all third-party AI provider API keys configured in the instance.
CVE-2026-120315: LobeHub LobeChat Path Traversal Remote Code Execution via writeTempFileVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in Instatic AI & Static CMS Platform documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)