Skip to content

CVE-2026-120315: LobeHub LobeChat Path Traversal Remote Code Execution via writeTempFile

Density:
C-Level Executive Briefing CVE-2026-120315 CRITICAL SCORE 97/100

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.

HYBRID

HERMES THREAT SCORE & AGENTIC INFRASTRUCTURE EVALUATION

Target: LobeHub LobeChat writeTempFile & Agent Workspace (< 2.1.49)
Confidence: 99%
97 / 100
CRITICAL

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 20 / 20
Threat Activity 19 / 20
Weaponization 20 / 20
Exposure 19 / 20
Prevalence 20 / 20
Impact 20 / 20
Exploit Maturity 19 / 20
Attack Chain Potential 20 / 20

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

  1. Host Compromise: Complete takeover of the underlying Docker container or host OS running LobeChat.
  2. LLM Key Harvest: Extraction of private API keys and tokens used by organization members.
  3. Session Interception: Hijacking active multi-tenant agent sessions, altering system prompts, and poisoning conversational memory.
  1. Upgrade LobeChat: Update to version 2.1.49 or newer immediately where strict canonical path containment (path.resolve) is enforced.
  2. Container Read-Only Filesystem: Deploy LobeChat with a read-only root filesystem (--read-only), mounting only a designated volatile /tmp volume.
  3. Credential Rotation: Rotate all third-party AI provider API keys configured in the instance.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-120315: LobeHub LobeChat Path Traversal Remote Code Execution via writeTempFileVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTInstatic AI & Static CMS Platform
98% VERY_HIGH

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

Supporting Verified Evidence: