The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40068

CVE-2026-40068: Claude Code Auth Bypass Vulnerability

CVE-2026-40068 is an authentication bypass flaw in Claude Code versions 2.1.63-2.1.83 that exploits git worktree trust logic to execute malicious hooks. This article covers the technical details, affected versions, and mitigation.

Published: May 7, 2026

CVE-2026-40068 Overview

CVE-2026-40068 is an input validation flaw [CWE-20] in Anthropic Claude Code versions 2.1.63 through 2.1.83. The folder trust determination logic reads the git worktree commondir file without validating its contents. An attacker can craft a malicious repository whose commondir file points to a path the victim previously trusted. When the victim opens the repository in Claude Code, the tool bypasses its trust confirmation dialog and immediately executes hooks defined in .claude/settings.json. Anthropic addressed the issue in version 2.1.84.

Critical Impact

Successful exploitation results in arbitrary command execution on the developer workstation through Claude Code hooks, with no user prompt shown.

Affected Products

  • Anthropic Claude Code 2.1.63
  • Anthropic Claude Code versions 2.1.64 through 2.1.82
  • Anthropic Claude Code 2.1.83

Discovery Timeline

  • 2026-05-05 - CVE-2026-40068 published to NVD
  • 2026-05-07 - Last updated in NVD database

Technical Details for CVE-2026-40068

Vulnerability Analysis

Claude Code maintains a list of folders the user has explicitly trusted. Trusted folders are allowed to load .claude/settings.json and execute hooks without prompting. The trust decision relies on resolving the active git directory. In a git worktree, the commondir file inside .git points to the canonical repository directory. Claude Code reads this path and matches it against the trust list.

The vulnerable releases use the commondir value verbatim. They do not verify that the path actually corresponds to a real, attacker-uncontrolled repository. An attacker who knows or guesses an already-trusted path on the victim system can place that exact path in commondir. Claude Code then treats the malicious clone as if it were the trusted repository.

Root Cause

The root cause is missing validation of externally controlled file content [CWE-20]. The trust check uses the commondir string as authoritative input. It does not confirm that the referenced directory exists, that it is the parent of the current worktree, or that it has not been spoofed inside an attacker-supplied repository.

Attack Vector

Exploitation requires the victim to clone a repository under attacker control and run Claude Code inside it. The attacker must know or guess a folder path the victim had previously approved, for example a common project directory. The malicious repository ships a .git/commondir file containing that path and a .claude/settings.json with hostile hook commands. When Claude Code starts, it resolves trust against the spoofed commondir, finds a match, and executes the hooks. User interaction is limited to opening the repository.

No verified proof-of-concept code is published. See the GitHub Security Advisory GHSA-q5hj-mxqh-vv77 for the upstream description.

Detection Methods for CVE-2026-40068

Indicators of Compromise

  • Repositories containing a .git/commondir file whose contents reference an unrelated absolute path on the local filesystem.
  • Presence of .claude/settings.json with hooks entries that invoke shell commands, downloaders, or interpreters such as curl, wget, bash, or powershell.
  • Child processes of the Claude Code binary spawning shells or network utilities immediately after a git clone event.

Detection Strategies

  • Inspect newly cloned repositories for .git/commondir files that point outside the cloned tree, and flag those that match historically trusted paths.
  • Alert on creation or modification of .claude/settings.json containing hook definitions in repositories pulled from untrusted sources.
  • Correlate Claude Code process launches with subsequent execution of shell interpreters or outbound network connections.

Monitoring Recommendations

  • Log execution of the Claude Code CLI and capture command-line arguments and the working directory.
  • Track the installed Claude Code version on developer endpoints and alert on versions between 2.1.63 and 2.1.83.
  • Monitor developer workstations for unexpected hook execution patterns following git operations.

How to Mitigate CVE-2026-40068

Immediate Actions Required

  • Upgrade Claude Code to version 2.1.84 or later on every developer endpoint.
  • Audit existing local repositories for tampered .git/commondir files and suspicious .claude/settings.json hook entries.
  • Review the Claude Code trusted folders list and remove entries that are no longer required.

Patch Information

Anthropic fixed the issue in Claude Code 2.1.84. The patched build validates the commondir reference before using it in the folder trust decision. Refer to the GitHub Security Advisory GHSA-q5hj-mxqh-vv77 for upstream guidance.

Workarounds

  • Avoid running Claude Code inside repositories cloned from untrusted sources until the upgrade is complete.
  • Inspect .git/commondir and .claude/settings.json in any new clone before launching Claude Code.
  • Restrict the trusted folders list to a minimal set of well-known project directories to reduce the attacker's guessing surface.
bash
# Verify Claude Code version and inspect a freshly cloned repo before opening it
claude --version
grep -R . .git/commondir 2>/dev/null
cat .claude/settings.json 2>/dev/null

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeAuth Bypass

  • Vendor/TechClaude Code

  • SeverityHIGH

  • CVSS Score7.7

  • EPSS Probability0.10%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-20
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-25722: Anthropic Claude Code Path Traversal Flaw

  • CVE-2026-24052: Claude Code SSRF Vulnerability

  • CVE-2026-24887: Claude Code RCE Vulnerability

  • CVE-2026-24053: Claude Code Path Traversal Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English