🇰🇷 한글 설명
PHP 5.2.3 이전 버전에서 open_basedir 및 safe_mode 제한이 특정 상황에서 우회되는 취약점입니다. 공격자는 readfile() 함수의 반환 동작 차이를 이용하여 임의의 파일 존재 여부를 파악할 수 있습니다.
💡 쉬운 설명
PHP의 파일 접근 제한 보안 설정이 제대로 작동하지 않는 문제입니다. 해커가 readfile() 함수로 서버의 특정 파일이 있는지 없는지 알아낼 수 있습니다.
🇺🇸 원문 (English)
PHP 5 before 5.2.3 does not enforce the open_basedir or safe_mode restriction in certain cases, which allows context-dependent attackers to determine the existence of arbitrary files by checking if the readfile function returns a string. NOTE: this issue might also involve the realpath function.
📍 영향받는 시스템
PHP 5.0.0 ~ 5.2.2 (모든 마이너 버전)
⚔️ 공격 벡터
readfile() 함수의 반환값 차이를 이용한 파일 존재 여부 정보 공개 공격
🛡️ 대응 방법
PHP를 5.2.3 이상으로 즉시 업그레이드 수행
🔧 검증 코드
PHP 버전이 5.2.3 미만이면 'Vulnerable' 표시, 5.2.3 이상이면 'Patched' 표시됨
php -r "echo (version_compare(PHP_VERSION, '5.2.3', '<') ? 'Vulnerable: '.PHP_VERSION : 'Patched: '.PHP_VERSION);
" 2>/dev/null || echo 'PHP not installed'