🔍 CVE-2004-0542

10.0
CVSS Score
HIGH
2004-08-06
2026-04-16 00:27
✅ 완료

🇰🇷 한글 설명

Win32 플랫폼의 PHP 4.3.7 이전 버전에서 escapeshellcmd()와 escapeshellarg() 함수가 '%', '|', '>' 등 셸 메타문자를 제대로 필터링하지 않아 공격자가 임의의 코드를 실행하고 파일을 덮어쓰며 환경 변수에 접근할 수 있습니다.

💡 쉬운 설명

PHP가 사용자 입력의 특수문자를 제대로 처리하지 못해 공격자가 의도하지 않은 명령어를 실행할 수 있습니다. 마치 은행 계좌에서 보안 검사를 우회하는 것과 같습니다.

🇺🇸 원문 (English)

PHP before 4.3.7 on Win32 platforms does not properly filter all shell metacharacters, which allows local or remote attackers to execute arbitrary code, overwrite files, and access internal environment variables via (1) the "%", "|", or ">" characters to the escapeshellcmd function, or (2) the "%" character to the escapeshellarg function.

📍 영향받는 시스템

PHP 4.3.7 이전 버전 (Win32 플랫폼)

⚔️ 공격 벡터

escapeshellcmd() 또는 escapeshellarg() 함수에 셸 메타문자('%', '|', '>')를 포함한 입력값 전달

🛡️ 대응 방법

PHP를 4.3.7 이상으로 즉시 업그레이드

🔧 검증 코드

PHP 버전이 4.3.7 미만이면 'VULNERABLE' 메시지와 함께 버전이 출력됩니다.

Shell / Script
php -v 2>/dev/null | grep -oE 'PHP [0-9]+\.[0-9]+\.[0-9]+' | awk '{split($2,a,"."); if(a[1]<4 || (a[1]==4 && a[2]<3) || (a[1]==4 && a[2]==3 && a[3]<7)) print "VULNERABLE: "$2; else print "SAFE: "$2}'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

PHP