🇰🇷 한글 설명
Symfony 프레임워크의 HeaderUtils::split() 함수에서 정규식 패턴 처리 오류로 인해 발생하는 ReDoS(정규 표현식 서비스 거부) 취약점입니다. 공격자가 특정 공백이 포함된 Cache-Control 헤더를 전송하면 CPU 사용량이 기하급수적으로 증가하여 서버 성능을 저하시키거나 중단시킬 수 있습니다.
💡 쉬운 설명
특수하게 조작된 웹 요청을 보내면 서버가 이를 처리하느라 모든 계산 능력을 소모하게 만드는 공격입니다. 이로 인해 웹사이트가 매우 느려지거나 아예 멈춰버릴 수 있습니다.
🇺🇸 원문 (English)
Symfony is a PHP framework for web and console applications and a set of reusable PHP components. Prior to versions 5.4.54, 6.4.46, 7.4.19, and 8.1.7, HeaderUtils::split() parsed header values with a pattern whose token alternative also matched whitespace, followed by a (?<!\s) lookbehind. A run of whitespace placed before a separator could be divided among the iterations of the enclosing repetition in exponentially many ways, and the engine tried all of them before settling. HeaderBag calls it for the Cache-Control header whenever a Request is built, so any application handling HTTP requests is reachable, with no authentication.
A single request carrying such a header costs close to a second of CPU (813 ms for a run of 17 spaces in an 8 KB header on PHP 8.5, doubling with each extra space). From 18 spaces on, preg_match_all() gives up at pcre.backtrack_limit and split() returns an empty array, so every directive of the header is silently dropped.
This issue affects symfony/http-foundation v4.1.0-BETA1 through v5.4.53, v6.0.0-BETA1 through v6.4.45, v7.0.0-BETA1 through v7.4.18, and v8.0.0-BETA1 through v8.1.6.
📍 영향받는 시스템
symfony/http-foundation v4.1.0-BETA1 ~ v5.4.53, v6.0.0-BETA1 ~ v6.4.45, v7.0.0-BETA1 ~ v7.4.18, v8.0.0-BETA1 ~ v8.1.6
⚔️ 공격 벡터
인증이 필요 없는 상태에서 조작된 공백이 포함된 HTTP Cache-Control 헤더를 포함한 요청을 전송
🛡️ 대응 방법
Symfony 프레임워크를 최신 보안 패치 버전(5.4.54, 6.4.46, 7.4.19, 8.1.7 이상)으로 업데이트
🔧 검증 코드
출력된 버전이 취약한 범위(v5.4.53 이하 등)에 포함되는지 확인
composer show symfony/http-foundation | grep 'versions'