🇰🇷 한글 설명
PHPUnit 12.5.21, 13.1.5 버전에서 자식 프로세스로 PHP INI 설정을 전달할 때 메타문자를 제대로 중립화하지 않아 발생하는 취약점입니다. 공격자는 개행 문자를 포함한 INI 값을 주입하여 여러 개의 INI 지시문으로 파싱되도록 만들 수 있습니다. 이를 통해 auto_prepend_file 등을 조작하여 원격 코드 실행에 이르를 수 있습니다.
💡 쉬운 설명
PHPUnit 테스트 도구에서 설정값을 자식 프로세스에 보낼 때 특수 문자를 처리하지 못해 문제가 발생합니다. 공격자가 이 문제를 악용하면 서버에서 임의의 코드를 실행할 수 있습니다.
🇺🇸 원문 (English)
PHPUnit is a testing framework for PHP. In versions 12.5.21 and 13.1.5, PHPUnit forwards PHP INI settings to child processes (used for isolated/PHPT test execution) as -d name=value command-line arguments without neutralizing INI metacharacters. Because PHP's INI parser interprets " as a string delimiter, ; as the start of a comment, and most importantly a newline as a directive separator, a value containing a newline is parsed by the child process as multiple INI directives. An attacker able to influence a single INI value can therefore inject arbitrary additional directives into the child's configuration, including auto_prepend_file, extension, disable_functions, open_basedir, and others. Setting auto_prepend_file to an attacker-controlled path yields remote code execution in the child process. This issue has been patched in versions 12.5.22 and 13.1.6.
📍 영향받는 시스템
PHPUnit 12.5.21, 13.1.5
⚔️ 공격 벡터
INI 값에 개행 문자를 주입하여 auto_prepend_file 등의 지시문을 추가하고 공격자 제어 파일을 로드하여 원격 코드 실행 달성
🛡️ 대응 방법
PHPUnit을 12.5.22 또는 13.1.6 이상으로 업그레이드
🔧 검증 코드
버전이 12.5.22 미만 또는 13.1.6 미만이면 취약하며, 해당 이상 버전으로 즉시 업그레이드 필요
composer show phpunit/phpunit 2>/dev/null | grep version