🇰🇷 한글 설명
PHP 파일명에 null byte (%00) 문자를 삽입하여 파일명 검증을 우회하는 취약점입니다. DOMDocument::save() 또는 GD imagepsloadfont() 함수를 통해 악의적으로 조작된 파일명으로 임의의 파일을 읽거나 쓸 수 있으며, .html만 생성 가능하도록 제한된 환경에서도 다른 파일 유형 접근이 가능합니다.
💡 쉬운 설명
공격자가 파일명에 특수 문자를 섞어서 보안 규칙을 속일 수 있는 문제입니다. 예를 들어 '.html 파일만 만들도록' 정해진 시스템에서 filename\0.php처럼 조작하면 다른 파일을 만들거나 접근할 수 있습니다.
🇺🇸 원문 (English)
PHP before 5.4.42, 5.5.x before 5.5.26, and 5.6.x before 5.6.10 does not ensure that pathnames lack %00 sequences, which might allow remote attackers to read or write to arbitrary files via crafted input to an application that calls (1) a DOMDocument save method or (2) the GD imagepsloadfont function, as demonstrated by a filename\0.html attack that bypasses an intended configuration in which client users may write to only .html files.
📍 영향받는 시스템
PHP 5.4.0~5.4.41, 5.5.0~5.5.25, 5.6.0~5.6.9
⚔️ 공격 벡터
null byte 삽입(filename\0.html 등)으로 파일명 검증 우회 후 DOMDocument::save() 또는 imagepsloadfont() 함수를 통해 임의 파일 읽기/쓰기
🛡️ 대응 방법
PHP를 5.4.42 이상, 5.5.26 이상, 5.6.10 이상으로 즉시 업그레이드
🔧 검증 코드
출력된 PHP 버전이 5.4.42 미만, 5.5.26 미만, 또는 5.6.10 미만이면 패치 필요
php -v 2>/dev/null | grep -oE 'PHP [0-9]+\.[0-9]+\.[0-9]+'