💡 쉬운 설명
Node.js WebSocket 서버가 너무 많은 요청 헤더를 받으면 강제로 중단될 수 있습니다. 공격자는 이를 이용해 서비스를 마비시킬 수 있습니다.
🇺🇸 원문 (English)
ws is an open source WebSocket client and server for Node.js. A request with a number of headers exceeding theserver.maxHeadersCount threshold could be used to crash a ws server. The vulnerability was fixed in
[email protected] (e55e510) and backported to
[email protected] (22c2876),
[email protected] (eeb76d3), and
[email protected] (4abd8f6). In vulnerable versions of ws, the issue can be mitigated in the following ways: 1. Reduce the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options so that no more headers than the server.maxHeadersCount limit can be sent. 2. Set server.maxHeadersCount to 0 so that no limit is applied.
📍 영향받는 시스템
ws < 8.17.1, ws < 7.5.10 (7.x 라인), ws < 6.2.3 (6.x 라인), ws < 5.2.4 (5.x 라인)
⚔️ 공격 벡터
maxHeadersCount 제한을 초과하는 다수의 HTTP 헤더를 포함한 WebSocket 업그레이드 요청 전송
🛡️ 대응 방법
ws를 최신 패치 버전으로 업그레이드 또는 --max-http-header-size 옵션으로 헤더 크기 제한
🔧 검증 코드
출력된 ws 버전이 8.17.1 이상 또는 해당 메이저 버전별 최소 요구 버전 이상인지 확인
npm ls ws 2>/dev/null | grep 'ws@' | head -1