{
  "id": "CVE-2026-40068",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-40068",
  "published_at": "2026-05-05T20:52:26.089Z",
  "title": "Claude Code arbitrary code execution via git worktree commondir trust dialog bypass",
  "vendor": "anthropics",
  "product": "claude-code",
  "cvss": {
    "score": 8.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In versions 2.1.63 through 2.1.83 of Claude Code, the folder trust determination logic used the git worktree commondir file without validating its contents. An attacker could craft a malicious repository with a commondir file pointing to a path the victim had previously trusted, causing Claude Code to bypass its trust confirmation dialog and immediately execute hooks defined in `.claude/settings.json`. Exploitation requires the victim to clone the malicious repository and run Claude Code within it, and the attacker must know or guess a path the victim had already trusted. This issue has been fixed in version 2.1.84.",
  "cwe": "CWE-20",
  "cpes": [
    "cpe:2.3:a:anthropic:claude_code:*:*:*:*:*:node.js:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.7,
    "nvd": 8.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "anthropics",
        "product": "claude-code",
        "ranges": [
          "\u003e= 2.1.63, \u003c 2.1.84"
        ],
        "fixed_in": [
          "2.1.84"
        ]
      }
    ],
    "upgrade": [
      "Upgrade claude-code to 2.1.84 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/anthropics/claude-code/security/advisories/GHSA-q5hj-mxqh-vv77"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
