🇰🇷 한글 설명
Enhanced Simple PHP Gallery (ESPG) 1.72의 gallery/comment.php에서 발견된 디렉토리 트래버설 취약점으로, 파일 매개변수에 '..' (점점)을 입력하여 서버 내 임의의 파일을 읽을 수 있습니다.
💡 쉬운 설명
웹사이트의 파일 읽기 기능에 보안 결함이 있어서, 공격자가 상위 폴더로 이동할 수 있는 '지름길'을 이용해 의도하지 않은 파일들을 읽을 수 있습니다. 마치 암호 없이 서버의 파일 시스템에 접근하는 것과 같습니다.
🇺🇸 원문 (English)
Directory traversal vulnerability in gallery/comment.php in Enhanced Simple PHP Gallery (ESPG) 1.72 allows remote attackers to read arbitrary files via a .. (dot dot) in the file parameter. NOTE: the vulnerability may be in my little homepage Comment script. If so, then this should not be treated as a vulnerability in ESPG.
📍 영향받는 시스템
Enhanced Simple PHP Gallery (ESPG) 버전 1.72 및 유사한 comment script
⚔️ 공격 벡터
gallery/comment.php의 file 파라미터에 ../ 시퀀스를 주입하여 디렉토리 트래버설 수행
🛡️ 대응 방법
ESPG를 최신 버전으로 업그레이드하거나, 파일 경로 입력값을 정규화(basename 사용 등)하여 ../ 패턴 차단
🔧 검증 코드
찾은 comment.php의 file 파라미터 처리 부분에서 입력값 검증(realpath, basename, preg_match) 부재 여부 확인
find / -name comment.php -path '*/gallery/*' 2>/dev/null | xargs grep -l 'file.*\$_' 2>/dev/null | head -1