/

CVE-2026-32846

Severity:

HIGH RISK

(7.5)

Path Traversal in OpenClaw Media Parsing

CVE-2026-32846

Modified

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read / Sensitive Data Exposure

Severity:

HIGH RISK

(7.5)

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 through 2026.3.23 contains a path traversal flaw in its media parsing logic that allows attackers to read arbitrary files on the host system by bypassing path validation in isLikelyLocalPath() and isValidMedia().

When an attacker can supply or influence media paths, they may escape the intended sandbox via incomplete validation and the allowBareFilename bypass, leading to disclosure of sensitive files such as system configs, environment files, and SSH keys.

Affected context

This vulnerability affects OpenClaw deployments that accept media paths or references from external or semi-trusted sources (e.g., user uploads, configuration, or remote content descriptors).

The issue lies in the media parsing layer, where file paths are checked for locality and validity using isLikelyLocalPath() and isValidMedia(), but the checks are incomplete.

In environments where the application is assumed to operate within a restricted media directory or sandbox, the allowBareFilename behavior can permit references that resolve to files outside that intended boundary.

Exploit preconditions

  • Attack surface: Any feature that accepts or processes media paths (file references, URLs, or similar) through OpenClaw's media parsing.
  • Required access: Ability to control or influence the media path input (e.g., authenticated or unauthenticated HTTP requests, API parameters, or configuration fields, depending on deployment).
  • Trigger point: Invocation of media parsing routines that call isLikelyLocalPath() and isValidMedia() with attacker-controlled paths.
  • Why exploitation is possible: Path validation is incomplete, and the allowBareFilename logic can be abused to craft traversal sequences that are not properly normalized or rejected, allowing paths that reference files outside the intended sandbox.

Why this happens

The core issue is an inadequate implementation of path validation and canonicalization, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

The isLikelyLocalPath() and isValidMedia() functions attempt to enforce that media paths are local and safe, but their checks can be bypassed due to incomplete normalization, inconsistent handling of relative components, and special-casing such as allowBareFilename.

Conceptually, the bug stems from relying on heuristic or pattern-based checks instead of deriving a canonical path and strictly enforcing that it resides within a predefined directory root, leading to trust in user-influenced paths that can escape the intended sandbox.

Potential impact

  • Disclosure of application configuration files that may contain secrets or database credentials
  • Exposure of system configuration files (e.g., password or service configuration stores)
  • Reading environment files that may include API keys, tokens, or other sensitive metadata
  • Access to private SSH keys and related authentication material stored on the host
  • Increased ability to pivot to other attacks by harvesting sensitive information (e.g., credentials reuse in other services)

General mitigation guidance

Effective mitigation focuses on strict path normalization and enforcement of directory boundaries, rather than heuristic checks:

  • Resolve all user-influenced paths to their canonical (absolute, normalized) form before use, removing .. and other relative components.
  • Enforce that all media paths resolve within a designated, fixed media root directory; reject or log any path that attempts to escape this root.
  • Avoid special flags like allowBareFilename that change validation behavior without re-verifying containment in the sandbox.
  • Treat any externally supplied path segments as untrusted, regardless of whether they look "local" or "benign".
  • Consider running the media handling component with minimal file-system privileges and isolating media storage from sensitive directories.
  • Apply a deny-by-default approach for file access, explicitly whitelisting directories or patterns that are intended to be accessible.

How teams detect issues like this

Organizations can identify this class of issues using a combination of automated and manual approaches:

  • Static analysis: Create rules that flag any use of file-system APIs where paths are derived from external input without canonicalization and strict directory checks.
  • Code review: Look for custom path validators such as isLikelyLocalPath() and isValidMedia() that rely on string matching (prefix/suffix checks, simple regexes) instead of canonical path containment checks.
  • Security testing: Use dynamic analysis or fuzzing to provide crafted media paths containing traversal sequences (../, nested directories, symlink abuse) and monitor whether the application returns unexpected file contents.
  • Policy enforcement: Incorporate secure file-access patterns into coding standards, and enforce them via pre-commit hooks or CI pipeline checks (including generalized SAST or custom linters).

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/4797bbc5b96e2cca5532e43b58915c051746fe37
github.comgithub.com/openclaw/openclaw/pull/54642
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-f6pf-4gjx-c94r
vulncheck.comvulncheck.com/advisories/openclaw-media-parsing-path-traversal-to-arbitrary-file-read

Frequently asked

questions

Exploitability depends on where and how OpenClaw processes media paths. If external users can directly control media references, the issue can be widely exploitable; if only internal or highly privileged components can set those paths, the risk is more constrained but still significant.

Not inherently. The key requirement is the ability to influence paths passed into the media parsing layer. In some deployments this may be available to unauthenticated users (e.g., public upload endpoints), while in others it may require authenticated or administrative access.

Centralize path handling so that all user-supplied paths are canonicalized and checked against a fixed, trusted root directory. Remove heuristic checks and ensure that any path that does not resolve inside the allowed directory is rejected, regardless of how benign it appears.

Establish a standard file-access utility that performs canonicalization and directory containment checks, and require its use for all file operations involving external input. Complement this with code review practices and automated checks focused on file access, and avoid ad hoc path validation logic scattered throughout the codebase.

Find out what's already
exploitable in your codebase.