🔍 CVE-2007-4840

5.0
CVSS Score
MEDIUM
2007-09-12
2026-04-23 00:35
✅ 완료

🇰🇷 한글 설명

PHP 5.2.4 이전 버전의 iconv 함수들에서 긴 문자열을 처리할 때 애플리케이션이 충돌하는 서비스 거부(DoS) 취약점입니다. out_charset, charset 파라미터를 통해 악용 가능하며, 멀티스레드 환경에서는 영향이 제한적이나 특정 조건에서 코드 실행이 가능할 수 있습니다.

💡 쉬운 설명

PHP의 문자 변환 함수(iconv)에 매우 긴 텍스트를 입력하면 프로그램이 멈출 수 있는 문제입니다. 이는 프로그램을 중단시키는 공격이며, 최신 웹서버 환경에서는 영향이 적을 수 있습니다.

🇺🇸 원문 (English)

PHP 5.2.4 and earlier allows context-dependent attackers to cause a denial of service (application crash) via (1) a long string in the out_charset parameter to the iconv function; or a long string in the charset parameter to the (2) iconv_mime_decode_headers, (3) iconv_mime_decode, or (4) iconv_strlen function. NOTE: this might not be a vulnerability in most web server environments that support multiple threads, unless these issues can be demonstrated for code execution.

📍 영향받는 시스템

PHP 5.2.4 이전 버전 및 iconv 확장 사용 시스템

⚔️ 공격 벡터

iconv, iconv_mime_decode_headers, iconv_mime_decode, iconv_strlen 함수의 out_charset 또는 charset 파라미터에 매우 긴 문자열 입력

🛡️ 대응 방법

PHP를 5.2.5 이상으로 업그레이드하거나, 사용자 입력 길이 검증 추가 및 iconv 확장 비활성화

🔧 검증 코드

PHP 버전 5.2.4 이하이면 VULNERABLE 표시, 5.2.5 이상이면 PATCHED 표시됩니다.

Shell / Script
php -v | grep -oE 'PHP [0-9.]+' | awk '{print $2}' | awk -F. '{if($1<5 || ($1==5 && $2<2) || ($1==5 && $2==2 && $3<=4)) print "VULNERABLE: PHP "$0; else print "PATCHED: PHP "$0}'

📊 CVSS Vector String

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

💻 영향받는 소프트웨어

PHP