{"url":"http://public2.vulnerablecode.io/api/packages/110292?format=json","purl":"pkg:npm/%40gitlawb/openclaude@0.5.1","type":"npm","namespace":"@gitlawb","name":"openclaude","version":"0.5.1","qualifiers":{},"subpath":"","is_vulnerable":false,"next_non_vulnerable_version":null,"latest_non_vulnerable_version":null,"affected_by_vulnerabilities":[],"fixing_vulnerabilities":[{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/95453?format=json","vulnerability_id":"VCID-5rah-1qe5-fkac","summary":"OpenClaude MCP OAuth Callback: State Check Bypass via error Param Leads to DoS\n# OAuth State Validation Bypass via `error` Parameter Causes Local Server DoS in MCP Auth Callback\n---\n\n## Description\n\nThe OpenClaude MCP authentication flow starts a temporary local HTTP server to handle OAuth callbacks. To prevent CSRF attacks, the server validates a `state` parameter against an internally stored value. However, due to a logic flaw in the order of conditionals, an attacker can completely bypass this check and force the server to shut down — without knowing the `state` value at all.\n\nThe vulnerable code looks like this:\n\n```typescript\nif (!error && state !== oauthState) {\n    rejectOnce(new Error('OAuth state mismatch - possible CSRF attack'))\n    return\n}\n\nif (error) {\n    cleanup()\n    rejectOnce(new Error(errorMessage))\n    return\n}\n```\n\nWhen a request arrives with an `error` query parameter (e.g., `?error=anything`), the first condition becomes `false` because `!error` evaluates to `false`. This means the CSRF check is **never reached**. Execution falls through to the second block, where `cleanup()` is called — shutting down the local server and terminating the user's active authentication session.\n\nThe attacker does not need to know the `state` value. Any request containing an `error` parameter is enough to trigger the shutdown.\n\n---\n\n## Impact\n\n- The user's OAuth flow is silently terminated mid-session\n- The local callback server is shut down (Denial of Service)\n- Can be triggered remotely via a malicious web page using a cross-origin request (CSRF)\n- No authentication or prior knowledge of the `state` value is required\n\n---\n\n## Steps to Reproduce\n\nSave the following as `poc.js` and run with Node.js:\n\n```javascript\nimport { createServer } from 'http';\nimport { parse } from 'url';\n\nconst expectedState = \"secure_state_abc123\";\n\nconst server = createServer((req, res) => {\n    const parsedUrl = parse(req.url || '', true);\n    const { pathname, query } = parsedUrl;\n    const { state, error } = query;\n\n    if (pathname === '/callback') {\n\n        // Vulnerable: error param causes state check to be skipped entirely\n        if (!error && state !== expectedState) {\n            res.writeHead(400);\n            res.end('State mismatch');\n            console.log('[-] CSRF attempt blocked.');\n            return;\n        }\n\n        if (error) {\n            res.writeHead(200);\n            res.end(`Error: ${error}`);\n            console.log(`[!] Server shutting down. Triggered by: ${error}`);\n            server.close();\n            return;\n        }\n    }\n});\n\nserver.listen(12345, '127.0.0.1', () => {\n    console.log('Listening on http://127.0.0.1:12345');\n});\n```\n\n**Terminal 1 — start the server:**\n```bash\nnode poc.js\n```\n\n**Terminal 2 — trigger the bypass:**\n```bash\ncurl \"http://127.0.0.1:12345/callback?error=triggered\"\n```\n\n**Expected result:** Server shuts down immediately. The `state` value was never checked.\n\n---\n\n## Root Cause\n\nThe CSRF protection is conditioned on `!error`, meaning it is silently disabled whenever an `error` parameter is present. The two checks need to be decoupled — state validation must happen first, independently of any other parameters.\n\n---\n\n## Fix\n\nMove the `state` check before the `error` check, and remove the dependency on `!error`:\n\n```typescript\n// Fixed\nif (state !== oauthState) {\n    cleanup()\n    rejectOnce(new Error('OAuth state mismatch - possible CSRF attack'))\n    return\n}\n\nif (error) {\n    cleanup()\n    rejectOnce(new Error(errorMessage))\n    return\n}\n```\n\nWith this change, any request — whether it contains an `error` parameter or not — must first pass the state validation before any further processing occurs.\n\n---\n\nCredit: Xanlar Agamalizade","references":[{"reference_url":"https://api.first.org/data/v1/epss?cve=CVE-2026-42073","reference_id":"","reference_type":"","scores":[{"value":"0.00036","scoring_system":"epss","scoring_elements":"0.11088","published_at":"2026-06-06T12:55:00Z"},{"value":"0.00036","scoring_system":"epss","scoring_elements":"0.11095","published_at":"2026-06-05T12:55:00Z"},{"value":"0.00036","scoring_system":"epss","scoring_elements":"0.11053","published_at":"2026-06-07T12:55:00Z"},{"value":"0.00039","scoring_system":"epss","scoring_elements":"0.11894","published_at":"2026-06-08T12:55:00Z"},{"value":"0.00039","scoring_system":"epss","scoring_elements":"0.11905","published_at":"2026-06-09T12:55:00Z"}],"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-42073"},{"reference_url":"https://github.com/Gitlawb/openclaude","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/Gitlawb/openclaude"},{"reference_url":"https://github.com/Gitlawb/openclaude/commit/739b8d1f40fde0e401a5cbd2b9a55d88bd5124ad","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-06-02T17:37:51Z/"}],"url":"https://github.com/Gitlawb/openclaude/commit/739b8d1f40fde0e401a5cbd2b9a55d88bd5124ad"},{"reference_url":"https://github.com/Gitlawb/openclaude/releases/tag/v0.5.1","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-06-02T17:37:51Z/"}],"url":"https://github.com/Gitlawb/openclaude/releases/tag/v0.5.1"},{"reference_url":"https://github.com/Gitlawb/openclaude/security/advisories/GHSA-c73c-x77g-854r","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:P/P:M/B:A/M:M/D:T/2026-06-02T17:37:51Z/"}],"url":"https://github.com/Gitlawb/openclaude/security/advisories/GHSA-c73c-x77g-854r"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42073","reference_id":"","reference_type":"","scores":[{"value":"6.5","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},{"value":"MODERATE","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42073"},{"reference_url":"https://github.com/advisories/GHSA-c73c-x77g-854r","reference_id":"GHSA-c73c-x77g-854r","reference_type":"","scores":[{"value":"MODERATE","scoring_system":"cvssv3.1_qr","scoring_elements":""}],"url":"https://github.com/advisories/GHSA-c73c-x77g-854r"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/110292?format=json","purl":"pkg:npm/%40gitlawb/openclaude@0.5.1","is_vulnerable":false,"affected_by_vulnerabilities":[],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/%2540gitlawb/openclaude@0.5.1"}],"aliases":["CVE-2026-42073","GHSA-c73c-x77g-854r"],"risk_score":null,"exploitability":null,"weighted_severity":null,"resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-5rah-1qe5-fkac"},{"url":"http://public2.vulnerablecode.io/api/vulnerabilities/89252?format=json","vulnerability_id":"VCID-vr1k-g53p-7fcx","summary":"OpenClaude: Sandbox Bypass via Early-Exit Logic Flaw Allows Path Traversal\nA 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 )","references":[{"reference_url":"https://api.first.org/data/v1/epss?cve=CVE-2026-35570","reference_id":"","reference_type":"","scores":[{"value":"0.00011","scoring_system":"epss","scoring_elements":"0.01352","published_at":"2026-06-09T12:55:00Z"},{"value":"0.00011","scoring_system":"epss","scoring_elements":"0.01353","published_at":"2026-06-08T12:55:00Z"},{"value":"0.00011","scoring_system":"epss","scoring_elements":"0.0136","published_at":"2026-06-07T12:55:00Z"},{"value":"0.00011","scoring_system":"epss","scoring_elements":"0.01357","published_at":"2026-06-05T12:55:00Z"}],"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-35570"},{"reference_url":"https://github.com/Gitlawb/openclaude","reference_id":"","reference_type":"","scores":[{"value":"8.4","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"},{"value":"HIGH","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://github.com/Gitlawb/openclaude"},{"reference_url":"https://github.com/Gitlawb/openclaude/commit/7002cb302b78ea2a19da3f26226de24e2903fa1d","reference_id":"","reference_type":"","scores":[{"value":"8.4","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"},{"value":"HIGH","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track*","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:T/P:M/B:A/M:M/D:R/2026-04-21T16:01:46Z/"}],"url":"https://github.com/Gitlawb/openclaude/commit/7002cb302b78ea2a19da3f26226de24e2903fa1d"},{"reference_url":"https://github.com/Gitlawb/openclaude/security/advisories/GHSA-m6rx-7pvw-2f73","reference_id":"","reference_type":"","scores":[{"value":"8.4","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"},{"value":"HIGH","scoring_system":"cvssv3.1_qr","scoring_elements":""},{"value":"HIGH","scoring_system":"generic_textual","scoring_elements":""},{"value":"Track*","scoring_system":"ssvc","scoring_elements":"SSVCv2/E:P/A:N/T:T/P:M/B:A/M:M/D:R/2026-04-21T16:01:46Z/"}],"url":"https://github.com/Gitlawb/openclaude/security/advisories/GHSA-m6rx-7pvw-2f73"},{"reference_url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35570","reference_id":"","reference_type":"","scores":[{"value":"8.4","scoring_system":"cvssv3.1","scoring_elements":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N"},{"value":"HIGH","scoring_system":"generic_textual","scoring_elements":""}],"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-35570"},{"reference_url":"https://github.com/advisories/GHSA-m6rx-7pvw-2f73","reference_id":"GHSA-m6rx-7pvw-2f73","reference_type":"","scores":[{"value":"HIGH","scoring_system":"cvssv3.1_qr","scoring_elements":""}],"url":"https://github.com/advisories/GHSA-m6rx-7pvw-2f73"}],"fixed_packages":[{"url":"http://public2.vulnerablecode.io/api/packages/110292?format=json","purl":"pkg:npm/%40gitlawb/openclaude@0.5.1","is_vulnerable":false,"affected_by_vulnerabilities":[],"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/%2540gitlawb/openclaude@0.5.1"}],"aliases":["CVE-2026-35570","GHSA-m6rx-7pvw-2f73"],"risk_score":4.0,"exploitability":"0.5","weighted_severity":"8.0","resource_url":"http://public2.vulnerablecode.io/vulnerabilities/VCID-vr1k-g53p-7fcx"}],"risk_score":null,"resource_url":"http://public2.vulnerablecode.io/packages/pkg:npm/%2540gitlawb/openclaude@0.5.1"}