🇰🇷 한글 설명
Guzzle PHP HTTP 클라이언트의 SetCookie::matchesDomain() 함수가 16진수나 혼합 진법 형태의 IP 주소를 올바르게 인식하지 못하는 취약점입니다. 이로 인해 특정 IP 주소로 설정된 쿠키가 의도치 않은 서브도메인이나 유사한 이름의 호스트로 전송되어 세션 토큰이 유출될 수 있습니다. 해당 문제는 Guzzle 7.15.2 및 8.0.1 버전에서 수정되었습니다.
💡 쉬운 설명
IP 주소를 특이한 방식으로 적었을 때, 프로그램이 이를 주소가 아닌 일반 이름으로 착각하여 쿠키를 엉뚱한 사이트에 보내버리는 문제입니다. 이 과정에서 사용자의 로그인 정보와 같은 중요한 쿠키가 해커의 사이트로 넘어갈 위험이 있습니다.
🇺🇸 원문 (English)
Guzzle is an extensible PHP HTTP client. Prior to 7.15.2 and 8.0.1, SetCookie::matchesDomain() gives every subdomain of a cookie Domain that cookie unless SetCookie::matchesDomain() recognizes the Domain as an IP literal or a numeric host, and the decision comes from the domain's own text, so two spellings a transport reads as an address keep subdomain scope. Hexadecimal and mixed-base forms such as 0x7f000001 and 0177.0.0.0x1 go unrecognized while libcurl 8.21.0 reads both as 127.0.0.1. A percent-escaped Domain keeps that scope on both branches because percent-decoding sits above numeric parsing, so 192.168.0.%31 and 127.0.0.1%2e are registered names in the URI grammar rather than address literals, and no numeric rule in any base classifies them, while libcurl decodes the host before resolving and reads them as 192.168.0.1 and 127.0.0.1. A cookie stored for Domain=0x7f000001 is placed in the Cookie header of a request to evil.0x7f000001, disclosing a session identifier or token to a host that is not that address, and a response from evil.0x7f000001 setting Domain=0x7f000001 is accepted into the jar and replayed to the address, so a server answering for the look-alike name can fix a session or set application state. Exploitation requires the application to enable cookie support, address an origin by one of these spellings, and contact a host whose name ends in that spelling. This issue is fixed in versions 7.15.2 and 8.0.1.
📍 영향받는 시스템
Guzzle versions prior to 7.15.2 and 8.0.1
⚔️ 공격 벡터
특수하게 인코딩된 IP 주소 형태를 사용하여 쿠키가 설정된 도메인과 일치하지 않는 호스트로 쿠키를 전송하도록 유도
🛡️ 대응 방법
Guzzle 라이브러리를 7.15.2 또는 8.0.1 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 버전이 7.15.2 미만이거나 8.0.1 미만인 경우 취약한 상태입니다.
composer show guzzlehttp/guzzle | grep 'versions'
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server