/

CVE-2026-28482

Severity:

HIGH RISK

(7.1)

Path Traversal in OpenClaw Transcript File Handling

CVE-2026-28482

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read and Write

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 construct transcript file paths using unsanitized sessionId and sessionFile parameters without verifying that the resulting paths remain within the intended agent sessions directory.

Authenticated attackers can exploit directory traversal sequences (for example, ../../etc/passwd) in these parameters to read or write arbitrary files on the server outside the transcript storage location.

Affected context

The vulnerability appears in OpenClaw components that generate transcript file paths based on client-supplied identifiers, such as sessionId and sessionFile, and then perform file I/O on those paths.

It is relevant where:

  • The application accepts these parameters from authenticated users,
  • The paths are combined with a base directory for agent session transcripts,
  • There is no effective normalization or containment check to keep file access within the session directory.

In such configurations, the file system permissions of the OpenClaw process determine how severe the data exposure or modification can be.

Exploit preconditions

  • Attack surface: HTTP or API endpoints that:
  • Accept sessionId or sessionFile parameters, and
  • Trigger transcript loading, saving, or export operations.
  • Required access: Valid authenticated access to OpenClaw with the ability to invoke the affected endpoints.
  • Trigger point: Sending specially crafted parameter values containing directory traversal sequences (e.g., "../" segments) that cause the constructed path to escape the intended transcript directory.
  • Why exploitation is possible: User-controlled path components are concatenated directly into filesystem paths without:
  • Normalizing and validating the final path,
  • Enforcing that it stays within the designated agent sessions directory,
  • Or strictly constraining acceptable file names to a safe pattern.

Why this happens

This issue is a classic example of CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The application builds file system paths for session transcript files by joining a trusted base directory with untrusted, user-supplied sessionId and sessionFile values.

Because these parameters can contain relative path elements like "../", the final resolved path can point outside the intended agent sessions directory.

The code path responsible for reading or writing these transcripts appears to trust the constructed path without:

  • Applying canonicalization and containment checks, or
  • Restricting the allowed characters or patterns to a safe subset.

As a result, authenticated users can influence which files the server process accesses, leading to arbitrary file read or write operations within the process's permission scope.

Potential impact

  • Reading sensitive system files that are accessible to the OpenClaw process (e.g., configuration files, logs, or credential stores).
  • Overwriting or creating files on the server filesystem where write permissions allow it, potentially impacting availability or behavior.
  • Accessing other users' session transcripts or internal application data that should not be exposed.
  • Facilitating privilege escalation or lateral movement when combined with other weaknesses (for example, modifying scripts or configuration files that are executed by privileged services).
  • Assisting in reconnaissance for further attacks by exposing system layout and configuration.

General mitigation guidance

Effective mitigation focuses on strictly controlling how file paths are derived from user input and enforcing directory containment:

  • Treat sessionId and sessionFile as opaque identifiers, not file paths:
  • Constrain them to a well-defined, minimal character set (e.g., alphanumerics plus a small, safe set of characters).
  • Validate them against a whitelist pattern (such as a regular expression) before using them.
  • Construct file paths using safe primitives:
  • Combine the base transcript directory with validated identifiers using standard path-joining APIs.
  • Canonicalize the resulting path and verify that it still resides under the designated sessions directory before any file I/O.
  • Avoid letting users control any path components that can introduce traversal (e.g., "/", "\", ".."):
  • Reject or sanitize such characters outright in these parameters.
  • Apply least privilege to the OpenClaw process:
  • Run it under an account with access only to the directories it legitimately needs.
  • Segregate transcript storage from sensitive system or configuration paths where feasible.
  • Consider adding an abstraction layer:
  • Map session identifiers to server-side file paths via a lookup table or database rather than deriving paths directly from request parameters.

How teams detect issues like this

Detection generally involves code-level review and behavioral monitoring:

  • Static analysis and code review:
  • Search for file I/O operations (open, read, write, append) that use request parameters (sessionId, sessionFile) or similarly named variables in path construction.
  • Flag any concatenation of user input into filesystem paths without validation, normalization, or containment checks.
  • Look for missing or incomplete checks that ensure the final path resides within the agent sessions directory.
  • Secure coding policies:
  • Enforce guidelines that disallow direct use of user input as part of file paths.
  • Use linting or SAST rules tailored to detect path traversal patterns, such as "../" segments in unvalidated inputs.
  • Runtime monitoring:
  • Log file access paths associated with transcript operations and alert on attempts to access locations outside the expected transcript directory.
  • Monitor for anomalous access to system-critical files originating from the OpenClaw process.
  • Automated tooling:
  • Incorporate SAST or IAST tools into CI pipelines, configured with rules for CWE-22.
  • Use API-level security testing to fuzz parameters like sessionId and sessionFile with traversal patterns and observe file access behavior.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/4199f9889f0c307b77096a229b9e085b8d856c26
github.comgithub.com/openclaw/openclaw/commit/cab0abf52ac91e12ea7a0cf04fff315cf0c94d64
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-5xfq-5mr7-426q
vulncheck.comvulncheck.com/advisories/openclaw-path-traversal-via-unsanitized-sessionid-and-sessionfile-parameters

Frequently asked

questions

Yes. Any authenticated client that can reach the affected OpenClaw endpoints and supply sessionId or sessionFile parameters may exploit the vulnerability, assuming the server uses those parameters to access transcript files.

The description indicates that attackers must be authenticated, but they do not need administrative privileges within OpenClaw. The severity of impact then depends on what files the OpenClaw process can access on the underlying system.

The most robust fix is to avoid treating user input as path components. Instead, validate identifiers against strict patterns, map them to server-controlled file locations, and enforce that any computed path is canonical and remains within an allowed base directory before performing file I/O.

Adopt a defensive design approach where:

  • User-controlled data is never trusted as a file path.
  • All file operations go through a centralized utility that performs validation and directory containment checks.
  • Secure coding standards and automated tests specifically cover path traversal scenarios, with CI-integrated static analysis to flag violations early.
Find out what's already
exploitable in your codebase.