🇰🇷 한글 설명
webpack-dev-server의 unauthenticated open-editor 엔드포인트에서 Host 헤더 검증 로직의 결함이 발견되었습니다. 공격자가 조작된 Host 헤더를 전송할 경우 서버 오류(HTTP 500)가 발생하며, 이때 노출되는 스택 트레이스를 통해 파일 시스템 경로, 모듈 위치, 소스 코드 라인 번호 등 민감한 정보가 유출될 수 있습니다.
💡 쉬운 설명
개발용 서버의 보안 검사 과정에 허점이 있어, 공격자가 특수한 요청을 보내면 서버 내부의 중요한 정보가 담긴 오류 메시지를 볼 수 있습니다. 이 정보는 해커가 서버의 구조를 파악하는 데 악용될 수 있습니다.
🇺🇸 원문 (English)
webpack-dev-server is a development server that provides live reloading for webpack projects. In versions from 5.1.0 before 5.2.7 and in version 6.0.0, the unauthenticated open-editor endpoint validates the Host header with a regular expression meant for browser Origin schemes, so a Host value beginning with file: or with an extension scheme short-circuits the hostname and allowedHosts checks. A network peer that can reach the dev server can send a request with a malformed Host that passes validation and then causes the endpoint's URL construction to throw, and in the default non-production mode the server returns an HTTP 500 body containing the full exception stack trace, which discloses absolute filesystem paths, installed module locations, and internal source line numbers. The server keeps running, so there is no denial of service. The issue is fixed in webpack-dev-server 5.2.7 and 6.1.0, and users should upgrade to one of those versions or later.
📍 영향받는 시스템
webpack-dev-server 5.1.0 ~ 5.2.6 및 6.0.0
⚔️ 공격 벡터
네트워크를 통해 접근 가능한 공격자가 조작된 Host 헤더(file: 또는 확장자 스킴 포함)를 포함한 요청을 전송
🛡️ 대응 방법
webpack-dev-server를 5.2.7 또는 6.1.0 이상의 버전으로 업그레이드
🔧 검증 코드
출력된 결과에서 webpack-dev-server의 버전을 확인하여 취약한 버전 범위에 해당하는지 체크
npm list webpack-dev-server