🇰🇷 한글 설명
gh 1.6.0 이상 2.92.0 미만에서 GitHub Actions 워크플로우 로그 조회 시 터미널 이스케이프 시퀀스를 검증 없이 실행하는 취약점. 공격자가 PR 트리거 워크플로우의 로그에 악의적인 시퀀스를 주입하면, 사용자가 로그 조회 시 터미널 조작, 임의 명령 실행 등이 가능.
💡 쉬운 설명
GitHub의 gh 도구로 워크플로우 로그를 볼 때 악의적인 명령어가 실행될 수 있습니다. 버전 2.92.0으로 업그레이드하면 해결됩니다.
🇺🇸 원문 (English)
`gh` is GitHub’s official command line tool. From 1.6.0 to before 2.92.0, a security vulnerability has been identified in GitHub CLI that could allow terminal escape sequence injection when users view GitHub Actions workflow logs using gh run view --log or gh run view --log-failed. The vulnerability stems from the way GitHub CLI handles raw Actions log output. The gh run view --log and gh run view --log-failed commands stream workflow log lines to stdout or the configured pager without sanitizing terminal control sequences. An attacker who can influence GitHub Actions log content, for example via a PR triggered workflow, can embed escape sequences that are replayed in the user's terminal when they inspect the run. Depending on the victim's terminal emulator, injected sequences could change the window title, manipulate on screen content, or in some terminal emulators (such as screen) potentially execute arbitrary commands. This vulnerability is fixed in 2.92.0.
📍 영향받는 시스템
GitHub CLI (gh) 1.6.0 ~ 2.91.x
⚔️ 공격 벡터
PR 트리거 워크플로우의 로그에 터미널 이스케이프 시퀀스 주입 후 사용자가 gh run view --log 실행
🛡️ 대응 방법
GitHub CLI를 2.92.0 이상으로 업그레이드
🔧 검증 코드
SAFE가 나오면 패치됨, VULNERABLE이 나오면 즉시 업그레이드 필요
gh --version | grep -oP '\d+\.\d+\.\d+' | awk -F. '{if($1>2 || ($1==2 && $2>92) || ($1==2 && $2==92 && $3>=0)) print "SAFE"; else print "VULNERABLE"}'