🔍 CVE-2026-46420

5.6
CVSS Score
MEDIUM
2026-07-17
2026-10-24 20:10
✅ 완료

🇰🇷 한글 설명

shivammathur/setup-php 2.25.0부터 2.37.1 미만 버전에서 발생하는 취약점으로, .php-version이나 composer.json과 같은 저장소 제어 파일에 포함된 PHP 버전 값을 검증 없이 셸 스크립트에 포함합니다. 이로 인해 pull_request_target 워크플로우가 공격자가 제어하는 콘텐츠를 체크아웃할 경우 GitHub Actions 러너에서 명령 주입(Command Injection)이 발생할 수 있습니다.

💡 쉬운 설명

해커가 조작한 설정 파일을 통해 GitHub의 자동화 서버에서 악성 명령어를 실행할 수 있는 보안 약점입니다. 설정 파일에 적힌 버전 정보 대신 몰래 실행하고 싶은 명령어를 적어 넣는 방식입니다.

🇺🇸 원문 (English)

setup-php is a GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and tools. From 2.25.0 prior to 2.37.1, shivammathur/setup-php resolves the PHP version from repository-controlled files such as .php-version, composer.lock through platform-overrides.php, and composer.json through config.platform.php, and insufficiently constrains those values before incorporating them into generated shell or PowerShell setup scripts, allowing command injection on a GitHub Actions runner when workflows such as pull_request_target check out attacker-controlled contents before invoking setup-php. This issue is fixed in version 2.37.1.

📍 영향받는 시스템

shivammathur/setup-php 버전 2.25.0 ~ 2.37.0

⚔️ 공격 벡터

공격자가 조작된 설정 파일(.php-version, composer.json 등)을 포함한 Pull Request를 생성하여 워크플로우 실행 시 명령 주입 유도

🛡️ 대응 방법

shivammathur/setup-php 액션을 버전 2.37.1 이상으로 업데이트

🔧 검증 코드

출력된 결과에서 사용 중인 setup-php의 버전이 2.37.1 미만인지 확인합니다.

Shell / Script
grep -r "shivammathur/setup-php@" .github/workflows/ 2>/dev/null | grep -E "@([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}|[0-9]{1,2}\.[0-9]{1,2})"

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L