/

CVE-2026-28459

Severity:

HIGH RISK

(7.1)

Path Traversal / External Control of File Path

CVE-2026-28459

Analyzed

Vulnerability type

Category:

Path Traversal / External Control of File Path

CWE:

CWE-73

Impact:

Arbitrary File Write and Potential Denial of Service

Severity:

HIGH RISK

(7.1)

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

OpenClaw versions prior to 2026.2.12 do not properly validate the sessionFile path parameter used for storing transcript data, allowing path values outside the intended sessions directory.

An authenticated gateway client can direct OpenClaw to create or append to arbitrary files on the host filesystem, which may lead to configuration corruption or denial of service if critical files are targeted.

Affected context

This vulnerability occurs in OpenClaw deployments where gateway clients can specify a sessionFile path for transcript storage.

The issue is present when:

  • The server accepts client-provided file paths without strict normalization and directory confinement
  • The process has write permissions outside the intended sessions directory
  • Transcript data is written/append to the disk based solely on the unvalidated sessionFile parameter

It primarily affects environments where configuration, logs, or other sensitive files reside on the same filesystem and are writable by the OpenClaw service account.

Exploit preconditions

  • Attack surface: Application-layer interface exposed to gateway clients (e.g., REST, RPC, or custom protocol) where sessionFile is accepted.
  • Required access: Authenticated gateway client access; the attacker must be able to establish a session and control the sessionFile parameter.
  • Trigger point: Any operation that causes the application to create or append a session transcript using the provided sessionFile path.
  • Why exploitation is possible: The application trusts the client-supplied path and does not strictly validate, normalize, or enforce confinement to the sessions directory, allowing file paths that resolve outside the intended storage location.

Why this happens

The underlying issue is the external control of a file path used in file creation and writing, aligning with CWE-73: External Control of File Name or Path.

Instead of treating the sessionFile parameter as untrusted input, the implementation appears to concatenate or otherwise combine it with filesystem operations without:

  • Normalizing the path
  • Rejecting traversal sequences or absolute paths
  • Enforcing that the resolved path is located under a dedicated sessions directory

This insecure pattern allows authenticated clients to influence where on the filesystem the application writes transcript data, turning a benign logging mechanism into a primitive for arbitrary file creation and uncontrolled data append operations.

Potential impact

  • Creation of arbitrary files on the host filesystem where the OpenClaw process has write permissions
  • Repeated appending of arbitrary transcript data to existing files, potentially corrupting configuration or state files
  • Induced denial of service by:
  • Filling disk space via large or repeated transcript writes
  • Corrupting critical configuration files so the service cannot start or function correctly
  • Interference with log files or other operational data, complicating monitoring and incident response
  • In some deployment-specific cases, influence over other components that rely on the integrity of modified files

General mitigation guidance

Effective mitigation focuses on eliminating direct use of client-controlled paths and constraining all file operations to safe locations.

Common defensive patterns include:

  • Path confinement ("chroot" for files):
  • Resolve and normalize all candidate paths and enforce that they remain inside a dedicated sessions directory.
  • Reject any request whose resolved path escapes this directory, regardless of the user identity.
  • Use identifiers, not raw paths:
  • Treat sessionFile as an opaque session identifier or token.
  • Map identifiers to server-generated filenames within a controlled directory, instead of allowing clients to specify path fragments.
  • Restrictive filesystem permissions:
  • Run the OpenClaw service under a dedicated OS account with write access only to its working/session directories.
  • Prevent write access to configuration directories and other sensitive locations.
  • Input validation and normalization:
  • Strip or reject absolute paths, drive letters, and path traversal sequences (../, ..\\, symlink tricks where feasible).
  • Apply a strict naming policy (e.g., whitelist of allowed characters and length) for any user-supplied file-related parameters.
  • Operational hardening:
  • Consider quotas or size limits on transcript files to reduce the impact of abuse.
  • Apply monitoring and alerting on unexpected file creation in sensitive directories.

How teams detect issues like this

Detection centers on both code-level review and runtime observability:

  • Static analysis and code scanning:
  • Flag uses of file APIs (open, create, append, write) where the path includes unvalidated client input such as sessionFile.
  • Search for concatenation of request parameters with filesystem paths, especially where no normalization or directory checks exist.
  • Enforce coding guidelines or linters that prohibit direct use of user input in filesystem operations.
  • Manual code review signals:
  • Handlers or controllers that accept file names or paths from authenticated clients.
  • Lack of canonicalization (e.g., realpath checks) or explicit verification that the resolved path resides under an allowed directory.
  • Absence of a centralized path-sanitization utility for all file-writing operations.
  • Runtime monitoring and logging:
  • Enable verbose logging of file-write targets when feasible, with safeguards for sensitive data, and alert on file writes outside expected directories.
  • Monitor for unusual growth in configuration or non-session files, or sudden spikes in filesystem usage.
  • Policy enforcement:
  • Use host or container security policies (e.g., MAC frameworks or sandboxing) to restrict filesystem write locations and log violations.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/25950bcbb8ba4d8cde002557f6e27c219ae4deda
github.comgithub.com/openclaw/openclaw/commit/4199f9889f0c307b77096a229b9e085b8d856c26
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-64qx-vpxx-mvqf
vulncheck.comvulncheck.com/advisories/openclaw-arbitrary-file-write-via-untrusted-sessionfile-path

Frequently asked

questions

It is remotely exploitable by any client that can authenticate as a gateway user and reach the affected OpenClaw interface, because the file path is controlled through application-level requests rather than local shell access.

No special OS-level privileges are required beyond whatever the OpenClaw process already has.

However, the attacker must have valid gateway client credentials and the OpenClaw service account must have write access to the targeted filesystem locations.

The safest pattern is to remove direct client control over file paths.

Treat file identifiers as opaque server-side keys, map them to internally generated filenames in a dedicated directory, and enforce that all file operations are confined to that directory with strict path normalization and permission controls.

Adopt a design where user input is never used directly as a filesystem path, centralize path validation and confinement logic, and enforce least-privilege filesystem permissions for application processes.

Combine these practices with static analysis checks and security-focused code review for any feature that interacts with the filesystem.

Find out what's already
exploitable in your codebase.