🔍 CVE-2014-9427

7.5
CVSS Score
HIGH
2015-01-03
2026-05-06 22:30
✅ 완료

🇰🇷 한글 설명

PHP의 CGI 모드에서 mmap을 사용하여 파일을 읽을 때, 샤프(#) 문자로 시작하고 newline이 없는 잘못된 .php 파일의 길이를 부적절하게 처리하여 out-of-bounds 읽기 취약점이 발생합니다. 이를 통해 PHP-CGI 프로세스 메모리에서 민감한 정보를 유출하거나 메모리에 있는 유효한 PHP 코드를 실행할 수 있습니다.

💡 쉬운 설명

PHP 웹 서버가 특정 형식의 파일을 읽을 때 메모리 경계를 넘어서 데이터를 읽는 버그가 있습니다. 공격자가 특수하게 만든 파일을 업로드하면 서버의 내부 정보를 빼내거나 코드를 실행할 수 있습니다.

🇺🇸 원문 (English)

sapi/cgi/cgi_main.c in the CGI component in PHP through 5.4.36, 5.5.x through 5.5.20, and 5.6.x through 5.6.4, when mmap is used to read a .php file, does not properly consider the mapping's length during processing of an invalid file that begins with a # character and lacks a newline character, which causes an out-of-bounds read and might (1) allow remote attackers to obtain sensitive information from php-cgi process memory by leveraging the ability to upload a .php file or (2) trigger unexpected code execution if a valid PHP script is present in memory locations adjacent to the mapping.

📍 영향받는 시스템

PHP 5.4.36 이전, 5.5.0-5.5.20, 5.6.0-5.6.4 (CGI 모드 사용 시)

⚔️ 공격 벡터

공격자가 웹 서버에 특수하게 조작된 .php 파일을 업로드하여 out-of-bounds read 트리거

🛡️ 대응 방법

PHP를 5.4.37, 5.5.21, 5.6.5 이상으로 업그레이드하거나 CGI 모드 대신 FastCGI 또는 mod_php 사용

🔧 검증 코드

PHP 버전이 5.4.37 미만, 5.5.21 미만, 또는 5.6.5 미만이면 취약함. 출력이 있으면 업그레이드 필요

Shell / Script
php -v | grep -E '5\.[456]' && echo 'Vulnerable version detected'

📊 CVSS Vector String

CVSS Vector
AV:N/AC:L/Au:N/C:P/I:P/A:P

💻 영향받는 소프트웨어

PHP