🇰🇷 한글 설명
z80pack 1.38 이전 버전에서 GitHub Actions 워크플로우가 GITHUB_TOKEN을 포함한 .git/config 파일을 artifact로 업로드합니다. 워크플로우 실행 중 artifact 다운로드 시 공격자가 토큰을 탈취하여 저장소에 악성 코드를 푸시하거나 릴리스 커밋을 변조할 수 있습니다.
💡 쉬운 설명
GitHub의 자동화 시스템에서 실수로 중요한 접근 토큰을 포함한 파일을 공개적으로 업로드했습니다. 누군가 그 토큰을 빼앗아 코드를 마음대로 수정할 수 있게 되는 위험한 상황입니다.
🇺🇸 원문 (English)
z80pack is a mature emulator of multiple platforms with 8080 and Z80 CPU. In version 1.38 and prior, the `makefile-ubuntu.yml` workflow file uses `actions/upload-artifact@v4` to upload the `z80pack-ubuntu` artifact. This artifact is a zip of the current directory, which includes the automatically generated `.git/config` file containing the run's GITHUB_TOKEN. Seeing as the artifact can be downloaded prior to the end of the workflow, there is a few seconds where an attacker can extract the token from the artifact and use it with the Github API to push malicious code or rewrite release commits in your repository. This issue has been fixed in commit bd95916.
📍 영향받는 시스템
z80pack 1.38 및 그 이전 버전, GitHub Actions 워크플로우를 사용하는 저장소
⚔️ 공격 벡터
makefile-ubuntu.yml 워크플로우에서 업로드된 artifact를 다운로드하여 .git/config에서 GITHUB_TOKEN을 추출하고 GitHub API로 악의적인 푸시 실행
🛡️ 대응 방법
z80pack을 커밋 bd95916 이후 버전으로 업그레이드하거나 워크플로우 파일에서 upload-artifact 작업을 제거/수정하여 .git 디렉토리가 포함되지 않도록 설정
🔧 검증 코드
명령어가 'Potentially Vulnerable'을 출력하면 워크플로우를 확인하고 패치(bd95916)가 적용되었는지 확인하세요. 'Not Vulnerable'이면 안전합니다.
grep -q 'upload-artifact@v4' .github/workflows/makefile-ubuntu.yml 2>/dev/null && echo 'Potentially Vulnerable' || echo 'Not Vulnerable'