🇰🇷 한글 설명
GitHub CLI 2.93.0 미만 버전에서 gh attestation, gh release verify 등의 명령어를 사용할 때 인증 헤더가 잘못된 호스트로 전송되는 취약점이 발견되었습니다. 호스트 정규화 로직 오류로 인해 github.com이 아닌 외부 호스트(tuf-repo.github.com 등)로 사용자의 GitHub 인증 토큰이 유출될 수 있습니다.
💡 쉬운 설명
GitHub 명령어를 사용할 때, 프로그램이 실수로 사용자의 비밀 열쇠(토큰)를 엉뚱한 외부 사이트에 전달할 수 있는 문제입니다. 이로 인해 해커가 사용자의 GitHub 권한을 가로챌 위험이 있습니다.
🇺🇸 원문 (English)
GitHub CLI (gh) is GitHub’s official command line tool. Prior to 2.93.0, GitHub CLI incorrectly includes authorization header in API requests to TUF repository mirrors via gh attestation, gh release verify, and gh release verify-asset commands. The CLI uses a shared HTTP client with an authentication layer that automatically attaches tokens to outgoing requests. This layer lacks accurate host detection and can incorrectly attribute the target host, providing it with a token it should never receive. Specifically, the host normalization logic collapses any *.github.com subdomain to github.com, so a request to tuf-repo.github.com (a GitHub Pages site, not a GitHub API endpoint) is treated as a request to github.com and receives the user's github.com token. For hosts that don't match github.com or a known GHES instance at all, the resolver falls back to GH_ENTERPRISE_TOKEN if set. The gh attestation, gh release verify and gh release verify-asset commands fetch data from several external hosts as part of their normal operation (TUF metadata from tuf-repo.github.com and tuf-repo-cdn.sigstore.dev, artifact bundles from Azure Blob Storage). Because these requests go through the same authenticated HTTP client, the token is sent to all of them. This vulnerability is fixed in 2.93.0.
📍 영향받는 시스템
GitHub CLI (gh) versions prior to 2.93.0
⚔️ 공격 벡터
취약한 명령어를 실행할 때 인증된 HTTP 클라이언트가 외부 호스트로 인증 토큰을 자동 전송하여 탈취됨
🛡️ 대응 방법
GitHub CLI를 2.93.0 이상의 최신 버전으로 업데이트하십시오.
🔧 검증 코드
출력 결과가 VULNERABLE이면 취약한 버전이며, SAFE이면 안전한 버전입니다.
gh --version | grep -E 'gh version 2\.[0-9]{2}\.' | awk '{print $3}' | awk -F'v' '{print $2}' | awk '$1 < 2.93.0 {print "VULNERABLE"} $1 >= 2.93.0 {print "SAFE"}'