🇰🇷 한글 설명
Claude Code 2.1.63~2.1.83 버전에서 git worktree의 commondir 파일을 검증 없이 사용하여 폴더 신뢰 확인 로직을 우회할 수 있습니다. 공격자가 피해자가 이전에 신뢰한 경로를 가리키는 악의적인 commondir 파일을 저장소에 포함시키면, Claude Code가 신뢰 확인 대화상자를 건너뛰고 .claude/settings.json의 훅을 자동 실행합니다.
💡 쉬운 설명
Claude Code가 폴더를 신뢰할 때 신뢰 확인을 제대로 검증하지 않아서, 악의적인 파일 설정으로 숨겨진 명령어를 자동 실행하게 할 수 있습니다. 피해자가 악의적인 저장소를 클론하고 Claude Code를 실행하면 허가 없이 훅이 실행됩니다.
🇺🇸 원문 (English)
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.
📍 영향받는 시스템
Claude Code 2.1.63~2.1.83
⚔️ 공격 벡터
악의적인 git 저장소의 commondir 파일을 통해 피해자가 이전 신뢰한 경로로 폴더 신뢰 우회 및 자동 훅 실행 유도
🛡️ 대응 방법
Claude Code를 2.1.84 이상으로 업그레이드
🔧 검증 코드
SAFE 출력 시 버전 2.1.84 이상으로 안전, VULNERABLE 출력 시 2.1.83 이하로 위험한 상태
claude --version 2>/dev/null | grep -oE '2\.[0-9]+\.[0-9]+' | awk -F. '{if($2==1){if($3>=84)print "SAFE";else print "VULNERABLE"}}' || echo 'UNKNOWN'