/

CVE-2026-120315

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in LobeHub Chat File Writing

CVE-2026-120315

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

LobeHub Chat has a path traversal vulnerability in temporary file handling that can let an authenticated user write files outside the intended location. If a crafted file name is processed during document parsing, application files may be overwritten, potentially causing code execution or denial of service.

Affected context

The issue occurs in LobeHub Chat file handling when names supplied to writeTempFile() are not adequately constrained. An authenticated user may create a file record with a traversal name and have it processed during document parsing. The risk depends on the application's filesystem permissions and whether the resulting path can reach sensitive files.

Exploit preconditions

  • Attack surface: File creation and document parsing functionality
  • Required access: An authenticated account with access to the relevant file operations
  • Trigger point: Processing a file record whose name is used when writing a temporary file
  • Why exploitation is possible: The file name is not sufficiently sanitized or confined to an approved directory before it is used to construct a filesystem path

Why this happens

The underlying issue is improper path validation, mapped to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). When user-controlled file names influence filesystem paths without reliable normalization and containment checks, path components can escape the intended directory and direct writes to unintended locations.

Potential impact

  • Sensitive application files may be overwritten
  • Application behavior may be disrupted, potentially causing denial of service
  • Code execution may be possible if an overwritten file is later loaded or executed by the application
  • Data integrity or availability could be affected

General mitigation guidance

Defensive patterns focus on ensuring file writes remain within explicitly approved directories.

  • Prefer server-generated identifiers or file names over user-supplied names.
  • Normalize and validate paths, then verify the resolved destination remains inside an allowed directory.
  • Use filesystem APIs or abstractions that enforce directory confinement.
  • Restrict write permissions for the application process and separate temporary storage from executable application files.
  • Treat uploaded or recorded file metadata as untrusted, including for authenticated users.

How teams detect issues like this

Review file-writing code for user-controlled names or paths reaching filesystem APIs without normalization and directory-containment checks. Static analysis can flag path construction involving untrusted input; code review can verify that validation occurs before every write and cannot be bypassed by alternate encodings or path forms. Runtime policies can also restrict writable locations and alert on writes to application code or other sensitive paths.

Sources

SourceLink
github.comgithub.com/lobehub/lobehub/security/advisories/GHSA-2g9j-v25c-4j97
vulncheck.comvulncheck.com/advisories/lobehub-chat-1.84.26-before-2.1.49-path-traversal-rce-via-writetempfile

Frequently asked

questions

It may be reachable through the application's file and document-processing features, but exploitation requires authenticated access.

An attacker needs an account with permission to use the relevant file creation and parsing functionality. The impact also depends on the application's filesystem permissions.

Avoid using user-provided names directly for filesystem paths, and enforce that every resolved write destination stays within an approved directory.

Use server-generated file names, apply consistent path normalization and containment checks, limit writable locations, and review file-handling code for untrusted data flowing into filesystem operations.

Find out what's already
exploitable in your codebase.