🇰🇷 한글 설명
Happy DOM은 그래픽 사용자 인터페이스 없이 동작하는 웹 브라우저의 JavaScript 구현체입니다. 20.14.6 이전 버전의 CookieContainer는 Domain 쿠키 속성을 올바르게 검증하지 않아, 쿠키를 설정한 출처와 무관한 Domain(공용 접미사 포함)을 허용하며, cookieMatchesURL이 DNS 레이블 경계를 강제하지 않아 접미사만 공유하는 무관한 호스트명도 일치하는 것으로 판단합니다. 이로 인해 SSR 및 프리렌더링 환경에서 쿠키 주입 또는 세션 고정 공격이 가능해집니다.
💡 쉬운 설명
웹 서버를 렌더링하는 도구(Happy DOM)에서 쿠키 도메인 검사가 느슨해서, 공격자 사이트가 피해자 사이트에 가짜 쿠키를 심을 수 있습니다. 이를 통해 사용자의 로그인 세션을 가로채거나 조작할 수 있습니다.
🇺🇸 원문 (English)
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Prior to 20.14.6, Happy DOM's CookieContainer in src/cookie/CookieContainer.ts does not correctly validate or match Domain cookie attributes. It can accept a Domain unrelated to the origin setting the cookie, including a public suffix, and separately treats an unrelated suffix-sharing hostname as a match because cookieMatchesURL does not enforce a DNS-label boundary. In server-side rendering and prerendering applications that contact attacker-controlled origins and then make requests to a victim origin, these behaviors can plant and deliver a forged cookie, enabling cookie injection or session fixation. This issue is fixed in version 20.14.6.
📍 영향받는 시스템
Happy DOM 20.14.6 미만 버전을 사용하는 Node.js 기반 SSR/프리렌더링 애플리케이션
⚔️ 공격 벡터
공격자가 제어하는 출처에서 조작된 Domain 속성의 쿠키를 설정한 뒤, 같은 렌더링 과정에서 피해자 출처로 요청을 보내 해당 쿠키가 전송되도록 유도
🛡️ 대응 방법
happy-dom을 20.14.6 이상으로 업그레이드하고 npm update happy-dom 후 재배포
🔧 검증 코드
출력된 버전이 20.14.6 미만이면 취약하므로 업그레이드가 필요하고, 20.14.6 이상이면 패치가 적용된 것입니다.
npm ls happy-dom 2>/dev/null | grep happy-dom
📊 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