🇰🇷 한글 설명
PHP 5.1.6 이전 버전의 symlink 함수에 존재하는 race condition으로, 로컬 사용자가 symlink, mkdir, unlink를 조합하여 open_basedir 검사 이후 파일 열기 전에 경로를 변경해 제한을 우회할 수 있습니다. 공격자는 상위 디렉토리를 가리키는 심링크를 생성 후 제거하는 방식으로 접근 제어를 우회합니다.
💡 쉬운 설명
PHP의 디렉토리 접근 제한을 파일 경로 변경으로 우회하는 취약점입니다. 심링크를 이용한 타이밍 공격으로 접근 제한된 디렉토리 외부 파일에 접근할 수 있습니다.
🇺🇸 원문 (English)
Race condition in the symlink function in PHP 5.1.6 and earlier allows local users to bypass the open_basedir restriction by using a combination of symlink, mkdir, and unlink functions to change the file path after the open_basedir check and before the file is opened by the underlying system, as demonstrated by symlinking a symlink into a subdirectory, to point to a parent directory via .. (dot dot) sequences, and then unlinking the resulting symlink.
📍 영향받는 시스템
PHP 5.1.6 및 이전 버전 (모든 POSIX-호환 시스템)
⚔️ 공격 벡터
symlink/mkdir/unlink 조합으로 open_basedir 검사 이후 파일 경로 조작
🛡️ 대응 방법
PHP를 5.1.7 이상으로 업그레이드하거나 open_basedir 권한 검토
🔧 검증 코드
PHP 5.1.6 이하 버전이 표시되면 취약. 5.1.7 이상이면 패치됨.
php -v 2>/dev/null | grep -E 'PHP 5\.(0|1\.[0-6])'