🇰🇷 한글 설명
QGIS의 GitHub Actions 워크플로우가 pull_request_target 트리거로 신뢰할 수 없는 외부 PR 코드를 저장소 자격증명과 함께 실행하여 원격 코드 실행 및 저장소 손상을 허용했던 취약점입니다. commit 76a693cd91650f9b4e83edac525e5e4f90d954e9에서 수정되었습니다.
💡 쉬운 설명
GitHub Actions가 외부 사용자의 PR 코드를 저장소의 모든 권한으로 자동 실행하여 공격자가 저장소를 완전히 장악할 수 있었습니다. 코드 검토 없이 외부 코드를 신뢰하는 것과 같은 위험한 상황입니다.
🇺🇸 원문 (English)
QGIS is a free, open source, cross platform geographical information system (GIS) The repository contains a GitHub Actions workflow called "pre-commit checks" that, before commit 76a693cd91650f9b4e83edac525e5e4f90d954e9, was vulnerable to remote code execution and repository compromise because it used the `pull_request_target` trigger and then checked out and executed untrusted pull request code in a privileged context. Workflows triggered by `pull_request_target` ran with the base repository's credentials and access to secrets. If these workflows then checked out and executed code from the head of an external pull request (which could have been attacker controlled), the attacker could have executed arbitrary commands with elevated privileges. This insecure pattern has been documented as a security risk by GitHub and security researchers. Commit 76a693cd91650f9b4e83edac525e5e4f90d954e9 removed the vulnerable code.
📍 영향받는 시스템
QGIS (commit 76a693cd91650f9b4e83edac525e5e4f90d954e9 이전 버전)
⚔️ 공격 벡터
악의적인 pull request를 생성하여 GitHub Actions 워크플로우 실행 시 저장소 credentials와 secrets으로 임의 코드 실행
🛡️ 대응 방법
저장소를 최신 버전으로 업데이트하거나 .github/workflows에서 pull_request_target을 pull_request로 변경하고 외부 코드 실행 전 검증 추가
🔧 검증 코드
커밋 76a693cd가 적용되었는지 확인하거나 워크플로우 파일에서 pull_request_target이 제거되었는지 검증
git log --oneline | grep -E '76a693cd|pull_request_target' | head -1