🇰🇷 한글 설명
Happy DOM은 그래픽 사용자 인터페이스 없이 동작하는 JavaScript 웹 브라우저 구현체입니다. 21.0.2 이전 버전의 server-renderer 패키지에서 인증되지 않은 HTTP/2 요청의 :path 값을 검증 없이 targetOrigin과 결합해 fetch하므로, 프로토콜 상대 경로를 이용해 서버가 접근 가능한 임의의 내부 또는 외부 엔드포인트로 요청을 보낼 수 있습니다.
💡 쉬운 설명
공격자가 서버를 중계기처럼 이용해 서버 내부망의 서비스나 외부 주소에 몰래 접근할 수 있습니다. 응답 내용까지 공격자에게 그대로 전달되어 내부 정보가 노출될 수 있습니다.
🇺🇸 원문 (English)
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. Prior to 21.0.2, the Happy DOM server-renderer package's ServerRendererServer accepts unauthenticated HTTP/2 requests and resolves attacker-controlled :path values against server.targetOrigin in #onIncomingRequest in packages/@happy-dom/server-renderer/src/ServerRendererServer.ts without confirming that the resolved origin remains trusted before calling fetch. A protocol-relative path can change the destination to an arbitrary HTTP or HTTPS endpoint reachable by the server, including local and internal services, and the proxy relays the fetched response headers and body to the requester. This issue is fixed in version 21.0.2.
📍 영향받는 시스템
Happy DOM server-renderer 패키지 21.0.2 미만 버전
⚔️ 공격 벡터
인증 없이 조작된 :path(예: //internal-host/...)를 포함한 HTTP/2 요청을 보내 SSRF를 유발하고 응답을 탈취
🛡️ 대응 방법
happy-dom을 21.0.2 이상으로 업그레이드하고, 서버를 외부에 노출하지 않으며 내부 네트워크 접근 제어를 적용
🔧 검증 코드
출력된 happy-dom 버전이 21.0.2 미만이면 취약하므로 21.0.2 이상으로 업그레이드가 필요하며, 아무 결과도 없으면 해당 패키지가 설치되지 않은 것입니다.
npm ls happy-dom 2>/dev/null | grep -E 'happy-dom@'