/

CVE-2026-35570

Severity:

HIGH RISK

(8.4)

Path Traversal / Authorization Logic Flaw in OpenClaude

CVE-2026-35570

Analyzed

Vulnerability type

Category:

Path Traversal / Authorization Logic Flaw

CWE:

CWE-22, CWE-284

Impact:

Sandbox Escape and Unauthorized File System Access

Severity:

HIGH RISK

(8.4)

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

OpenClaude versions prior to 0.5.1 contain a logic flaw in the Bash tool permission check that can allow shell commands to escape intended directory restrictions.

When sandbox auto-allow is enabled and no explicit deny rules exist, path traversal sequences in commands may bypass path constraint filtering, potentially granting unauthorized file system access.

Affected context

This vulnerability affects OpenClaude deployments that use the Bash tool with the sandbox auto-allow feature enabled and no explicit deny rules configured.

In this configuration, the permission check logic short-circuits and returns an "allow" decision before path constraints are evaluated, meaning commands with traversal patterns such as ../ may be executed outside the intended sandbox directory.

The risk is most significant when the Bash tool is used against host file systems with sensitive data or powerful OS utilities.

Exploit preconditions

  • Attack surface: The Bash tool command execution interface exposed by OpenClaude (CLI, agents, or any workflow that lets users or external inputs influence shell commands).
  • Required access: Ability to cause OpenClaude to run Bash commands (directly via CLI arguments, prompts to the coding agent, or integrated tooling).
  • Trigger point: Execution of a command while:
  • The sandbox auto-allow feature is active, and
  • No explicit deny rule is present for the targeted path or command.
  • Why exploitation is possible: The bashToolHasPermission() function returns an "allow" result as soon as auto-allow applies, without invoking checkPathConstraints, so directory traversal sequences are never filtered or rejected.

Why this happens

The core issue is an authorization logic flaw combined with insufficient path validation.

Instead of enforcing a strict evaluation order—first validating paths, then applying allow/deny decisions—the permission function short-circuits on an auto-allow condition when no deny rule is configured.

This prematurely grants permission without checking path traversal or directory boundaries, mapping to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because traversal sequences can escape the intended sandbox.
  • CWE-284: Improper Access Control, because the access control logic fails to reliably apply path constraints before authorizing execution.

Abstractly, this pattern reflects any system where convenience shortcuts (auto-allow) are evaluated before safety checks (path constraints), leaving security controls unenforced.

Potential impact

  • Unauthorized reading of files outside the intended sandbox directory (e.g., system configuration or application secrets).
  • Unauthorized modification or deletion of files reachable via the traversal path.
  • Execution of shell commands in directories that were meant to be restricted.
  • Escalation of the coding agent's effective capabilities, potentially impacting the host system or adjacent projects.
  • Violation of tenant or project isolation if multiple workspaces are assumed to be separated by directory constraints.

General mitigation guidance

Effective mitigation focuses on enforcing path checks unconditionally and narrowing the Bash tool's authority:

  • Ensure that any permission check function always evaluates path constraints before returning an allow/deny decision, regardless of auto-allow settings.
  • Normalize and canonicalize paths (e.g., resolving .. and symbolic links) before comparison to sandbox roots, then enforce strict "must-be-under-root" checks.
  • Treat auto-allow features as advisory convenience layers, not as a replacement for hard security boundaries; safeguards should remain in force even when auto-allow is enabled.
  • Configure the Bash tool to run with least privilege (separate OS user, restricted file system permissions) so that even if traversal occurs, damage is limited.
  • Consider default-deny patterns for file system access, where explicit allowlists define which directories or file types can be touched, instead of relying on denylists.
  • Where possible, separate sensitive configuration and secrets from directories that the Bash tool user can access.

How teams detect issues like this

Organizations can look for this class of flaw using a mix of static and process-based techniques:

  • Static analysis and code review:
  • Identify authorization functions where "auto-allow" or "fallback allow" paths exist and verify that validation (path checks, scope checks) is always executed first.
  • Flag early returns in permission-checking functions that bypass security-relevant filters such as checkPathConstraints or path normalization helpers.
  • Review any code handling file paths from user-driven inputs (including prompts to agents) for missing checks against a defined root directory.
  • Configuration and policy checks:
  • Periodically scan OpenClaude configurations to detect where sandbox auto-allow is enabled without complementary deny or allow rules.
  • Enforce internal policies that require explicit sandbox boundaries and documented rationale when auto-allow is used.
  • Runtime monitoring:
  • Monitor process activity of the Bash tool user for file access outside expected sandbox directories.
  • Implement logging of commands executed via the Bash tool and alert on suspicious patterns like repeated ../ sequences or access to high-value paths (e.g., /etc, home directories, SSH keys).
  • Automated code review tools can be configured with custom rules to highlight permission-checking functions that contain early allow branches or that do not invoke path constraint checks in all code paths.

Sources

SourceLink
github.comgithub.com/Gitlawb/openclaude/commit/7002cb302b78ea2a19da3f26226de24e2903fa1d
github.comgithub.com/Gitlawb/openclaude/security/advisories/GHSA-m6rx-7pvw-2f73

Frequently asked

questions

Exploitability depends on how OpenClaude is used. If users or integrated systems can influence Bash commands while sandbox auto-allow is active and no deny rules are set, they may be able to traverse out of the intended directory. In tightly controlled, purely local setups where commands are not influenced by untrusted input, the risk is reduced.

Not necessarily. The key requirement is the ability to cause OpenClaude to run Bash commands—this can be via direct CLI usage, prompts to an automated coding agent, or other tooling that passes commands to the Bash tool. The attacker does not need standalone shell access if they can steer the agent.

Ensure that all permission decisions are made after path normalization and constraint checks have been applied, with no early-allow branches. Treat path constraint evaluation as mandatory for every code path, and prefer explicit allowlists of permissible directories over auto-allow shortcuts. Additionally, isolate the Bash tool using least-privilege OS accounts and file system permissions.

Design authorization flows so that validation and constraint checks are the first and last steps before an allow decision. Avoid configuration options that can bypass core safety checks, or keep them disabled by default. During code review, focus on permission-checking functions, examining all early returns and defaults. Complement this with automated tests that attempt directory traversal and sandbox-escape scenarios to ensure constraints are enforced end-to-end.

Find out what's already
exploitable in your codebase.