CVE-2026-35570: OpenClaude Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-m6rx-7pvw-2f73
CVSS 8.4
CWE-284 CWE-22
Published
Advisory Summary

CVE-2026-35570 is a HIGH (CVSS 8.4) path traversal vulnerability (CWE-284: Improper Access Control) affecting OpenClaude libraries in the npm ecosystem. The issue involves sandbox bypass via early-exit logic flaw allows path traversal. Remediation is available by upgrading affected packages to version 0.5.1.

CVE-2026-35570 at a Glance

CVE Identifier CVE-2026-35570
GHSA Identifier GHSA-m6rx-7pvw-2f73
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-284: Improper Access Control
Affected Product OpenClaude
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-35570

To remediate this vulnerability, upgrade all affected OpenClaude dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@gitlawb/openclaude fixed: 0.5.1
npm install @gitlawb/openclaude@0.5.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @gitlawb/openclaude

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-35570, inspect your project dependencies using npm:

npm ls @gitlawb/openclaude

Analyze the terminal output to locate any version of OpenClaude in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.5.1), your application is affected.

Note: The npm ls @gitlawb/openclaude command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In OpenClaude, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A logic flaw exists in `bashToolHasPermission()` inside `src/tools/BashTool/bashPermissions.ts`. When the sandbox auto-allow feature is active and no explicit deny rule is configured, the function returns an `allow` result immediately — before the path constraint filter (`checkPathConstraints`) is ever evaluated. This allows commands containing path traversal sequences (e.g., `../../../../../etc/passwd`) to bypass directory restrictions entirely. ## Affected Component - **File:** `src/tools/BashTool/bashPermissions.ts` - **Function:** `bashToolHasPermission` - **Location:** ~line 1445 (sandbox auto-allow block) ## Vulnerable Code Flow ``` bashToolHasPermission() │ ├─ [~1445] Sandbox auto-allow block │ └─ No deny rule found → return ALLOW ⚠️ Early exit │ └─ [~1644] checkPathConstraints() ❌ Never reached ``` The sandbox block was designed to skip interactive permission prompts in sandboxed environments. However, it unintentionally also skips the path traversal filter, which is a separate and critical security control. ## Impact Any process or user operating in a sandboxed session with no explicit deny rules can: - Read arbitrary files outside the sandbox boundary (e.g., `/etc/passwd`, `/etc/shadow`, `.env` files, SSH private keys) - Write to arbitrary paths (subject to OS-level permissions) - Fully defeat the filesystem isolation that the sandbox is intended to enforce ## Steps to Reproduce 1. Enable sandbox mode: `SandboxManager.isSandboxingEnabled() = true` 2. Enable auto-allow: `SandboxManager.isAutoAllowBashIfSandboxedEnabled() = true` 3. Ensure no explicit deny rules are configured for the session 4. Submit a bash command with a path traversal payload: ``` cat ../../../../../etc/passwd ``` 5. Observe that the command receives `behavior: allow` without triggering `checkPathConstraints` ## Recommended Fix The sandbox auto-allow block should **never short-circuit the full permission pipeline**. It may suppress interactive prompts, but path constraint validation must always execute. ### Option 1 — Preferred: Continue pipeline on `allow` Only return early for `deny` or `ask` behaviors. Let `allow` fall through to `checkPathConstraints`: ```typescript if ( SandboxManager.isSandboxingEnabled() && SandboxManager.isAutoAllowBashIfSandboxedEnabled() && shouldUseSandbox(input) ) { const sandboxAutoAllowResult = checkSandboxAutoAllow( input, appState.toolPermissionContext, ); if (sandboxAutoAllowResult.behavior !== 'allow') { // Only block or prompt — never skip path checks on allow return sandboxAutoAllowResult; } // If 'allow', continue to checkPathConstraints below } ``` ### Option 2 — Defense in depth: Run path check before returning Run `checkPathConstraints` explicitly inside the sandbox block before returning: ```typescript if (sandboxAutoAllowResult.behavior !== 'passthrough') { const pathCheck = checkPathConstraints(input, appState.toolPermissionContext); if (pathCheck.behavior !== 'allow') { return pathCheck; // Block traversal attempts even in sandbox } return sandboxAutoAllowResult; } ``` ### Option 3 — Minimal change: Move sandbox block after path check Reorder the function so `checkPathConstraints` always runs first, and the sandbox block only handles the prompt-suppression logic afterward. --- Credit: Elvin Latifli (@Rickidevs )

CVE-2026-35570 Affected OpenClaude Versions

1 component(s)
Fixed Versions:
0.5.1
Product / Package Ecosystem Affected Versions Fixed Version
@gitlawb/openclaude
npm
< 0.5.1
0.5.1

References

Frequently Asked Questions

What is CVE-2026-35570?
CVE-2026-35570 is a security vulnerability in OpenClaude involving Sandbox Bypass via Early-Exit Logic Flaw Allows Path Traversal under CWE-284: Improper Access Control.
Which OpenClaude versions are affected?
Affected versions include releases prior to 0.5.1 across affected packages: @gitlawb/openclaude.
What version fixes CVE-2026-35570?
Upgrading to 0.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @gitlawb/openclaude affected?
Yes, @gitlawb/openclaude is affected in releases prior to 0.5.1. Upgrade your dependency to 0.5.1 or later.
What is the CVSS score of CVE-2026-35570?
CVE-2026-35570 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N.
What CWE is associated with CVE-2026-35570?
CVE-2026-35570 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2026-35570?
Run the dependency tree command: 'npm ls @gitlawb/openclaude'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m6rx-7pvw-2f73",
  "modified" : "2026-04-21T15:16:16Z",
  "published" : "2026-04-21T15:16:16Z",
  "aliases" : [ "CVE-2026-35570" ],
  "summary" : "OpenClaude: Sandbox Bypass via Early-Exit Logic Flaw Allows Path Traversal ",
  "details" : "A logic flaw exists in `bashToolHasPermission()` inside `src/tools/BashTool/bashPermissions.ts`. When the sandbox auto-allow feature is active and no explicit deny rule is configured, the function returns an `allow` result immediately — before the path constraint filter (`checkPathConstraints`) is ever evaluated. This allows commands containing path traversal sequences (e.g., `../../../../../etc/passwd`) to bypass directory restrictions entirely.\n\n## Affected Component\n\n- **File:** `src/tools/BashTool/bashPermissions.ts`\n- **Function:** `bashToolHasPermission`\n- **Location:** ~line 1445 (sandbox auto-allow block)\n\n## Vulnerable Code Flow\n\n```\nbashToolHasPermission()\n    │\n    ├─ [~1445] Sandbox auto-allow block\n    │       └─ No deny rule found → return ALLOW  ⚠️ Early exit\n    │\n    └─ [~1644] checkPathConstraints()             ❌ Never reached\n```\n\nThe sandbox block was designed to skip interactive permission prompts in sandboxed environments. However, it unintentionally also skips the path traversal filter, which is a separate and critical security control.\n\n## Impact\n\nAny process or user operating in a sandboxed session with no explicit deny rules can:\n\n- Read arbitrary files outside the sandbox boundary (e.g., `/etc/passwd`, `/etc/shadow`, `.env` files, SSH private keys)\n- Write to arbitrary paths (subject to OS-level permissions)\n- Fully defeat the filesystem isolation that the sandbox is intended to enforce\n\n## Steps to Reproduce\n\n1. Enable sandbox mode: `SandboxManager.isSandboxingEnabled() = true`\n2. Enable auto-allow: `SandboxManager.isAutoAllowBashIfSandboxedEnabled() = true`\n3. Ensure no explicit deny rules are configured for the session\n4. Submit a bash command with a path traversal payload:\n   ```\n   cat ../../../../../etc/passwd\n   ```\n5. Observe that the command receives `behavior: allow` without triggering `checkPathConstraints`\n\n## Recommended Fix\n\nThe sandbox auto-allow block should **never short-circuit the full permission pipeline**. It may suppress interactive prompts, but path constraint validation must always execute.\n\n### Option 1 — Preferred: Continue pipeline on `allow`\n\nOnly return early for `deny` or `ask` behaviors. Let `allow` fall through to `checkPathConstraints`:\n\n```typescript\nif (\n  SandboxManager.isSandboxingEnabled() &&\n  SandboxManager.isAutoAllowBashIfSandboxedEnabled() &&\n  shouldUseSandbox(input)\n) {\n  const sandboxAutoAllowResult = checkSandboxAutoAllow(\n    input,\n    appState.toolPermissionContext,\n  );\n  if (sandboxAutoAllowResult.behavior !== 'allow') {\n    // Only block or prompt — never skip path checks on allow\n    return sandboxAutoAllowResult;\n  }\n  // If 'allow', continue to checkPathConstraints below\n}\n```\n\n### Option 2 — Defense in depth: Run path check before returning\n\nRun `checkPathConstraints` explicitly inside the sandbox block before returning:\n\n```typescript\nif (sandboxAutoAllowResult.behavior !== 'passthrough') {\n  const pathCheck = checkPathConstraints(input, appState.toolPermissionContext);\n  if (pathCheck.behavior !== 'allow') {\n    return pathCheck; // Block traversal attempts even in sandbox\n  }\n  return sandboxAutoAllowResult;\n}\n```\n\n### Option 3 — Minimal change: Move sandbox block after path check\n\nReorder the function so `checkPathConstraints` always runs first, and the sandbox block only handles the prompt-suppression logic afterward.\n\n---\n\nCredit: Elvin Latifli (@Rickidevs )",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@gitlawb/openclaude"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Gitlawb/openclaude/security/advisories/GHSA-m6rx-7pvw-2f73"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35570"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Gitlawb/openclaude/commit/7002cb302b78ea2a19da3f26226de24e2903fa1d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Gitlawb/openclaude"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-21T15:16:16Z",
    "nvd_published_at" : "2026-04-21T00:16:28Z"
  }
}