🇰🇷 한글 설명
Node.js용 HTTP 클라이언트 라이브러리인 undici의 특정 버전에서 HTTP/2를 통한 WebSocket 핸드셰이크 실패 시 스트림을 제대로 처리하지 못하는 취약점이 발견되었습니다. 악의적인 서버가 연결을 강제로 종료하면 처리되지 않은 오류가 발생하여 Node.js 프로세스가 종료될 수 있습니다. 이로 인해 원격의 인증되지 않은 공격자가 클라이언트 서비스를 중단시키는 서비스 거부(DoS) 공격이 가능합니다.
💡 쉬운 설명
특정 라이브러리를 사용하는 프로그램이 나쁜 서버와 연결을 시도할 때, 서버가 연결을 갑자기 끊어버리면 프로그램 자체가 강제로 꺼져버리는 문제입니다. 이를 통해 공격자는 대상 서비스를 마비시킬 수 있습니다.
🇺🇸 원문 (English)
undici is an HTTP client library for Node.js. In versions 8.11.0 and 8.11.1, its experimental WebSocket client, which is enabled by default when HTTP/2 is allowed, mishandles a failed WebSocket handshake over HTTP/2: the request is already marked completed, so the abort becomes a no-op and the underlying HTTP/2 stream is left open with no error listener. When a malicious server then destroys the connection, the orphaned stream emits an unhandled error and the Node.js process exits. A remote, unauthenticated server can therefore crash any client that opens a WebSocket to it over HTTP/2, resulting in a denial of service. The issue is fixed in undici 8.11.2, and users should upgrade to 8.11.2 or later. As a workaround, set allowH2 to false to disable HTTP/2 for WebSocket connections, or avoid opening WebSocket connections to untrusted servers.
📍 영향받는 시스템
undici versions 8.11.0 and 8.11.1
⚔️ 공격 벡터
Remote, unauthenticated server via HTTP/2 WebSocket handshake failure
🛡️ 대응 방법
Upgrade undici to version 8.11.2 or later, or set allowH2 to false
🔧 검증 코드
출력된 undici의 버전이 8.11.0 또는 8.11.1인지 확인하여 취약 여부를 판단합니다.
npm list undici | grep undici@, then check if version is 8.11.0 or 8.11.1