🇰🇷 한글 설명
@hapi/content은 HTTP Content-* 헤더 파싱을 담당하는 라이브러리입니다. 3.0.6 이상 6.0.3 미만 버전에서는 Content-Disposition 파라미터에 등호 없이 긴 토큰이 포함될 경우 정규식 처리가 이차 시간 복잡도로 동작하여 Node.js 이벤트 루프가 차단될 수 있습니다. 이 문제는 @hapi/content 6.0.3에서 수정되었습니다.
💡 쉬운 설명
특수하게 조작된 HTTP 요청 헤더 하나로 서버의 Node.js 프로그램이 매우 오랫동안 멈출 수 있는 취약점입니다. 인증 없이도 공격이 가능하여 서비스 거부(DoS) 피해가 발생할 수 있습니다.
🇺🇸 원문 (English)
@hapi/content provides HTTP Content-* header parsing. From 3.0.6 until 6.0.3, Content.disposition() uses an unanchored parameter-name expression in a global regular-expression scan, causing repeated failed matching over the remaining input when a Content-Disposition parameter contains a long token without an equals sign. The resulting quadratic processing can block the Node.js event loop before route handlers or validation when @hapi/pez parses multipart/form-data headers, including unauthenticated hapi routes with payload.multipart enabled, and also affects applications that pass untrusted headers directly to Content.disposition(). This issue is fixed in @hapi/content version 6.0.3.
📍 영향받는 시스템
@hapi/content 3.0.6 이상 6.0.3 미만을 사용하는 Node.js hapi 애플리케이션 (특히 @hapi/pez 및 payload.multipart 사용 시)
⚔️ 공격 벡터
multipart/form-data 요청의 Content-Disposition 헤더 파라미터에 등호 없이 매우 긴 토큰을 포함시켜 전송하여 이벤트 루프를 차단
🛡️ 대응 방법
@hapi/content를 6.0.3 이상으로 업그레이드하고 npm update @hapi/content 후 애플리케이션을 재배포
🔧 검증 코드
출력된 버전이 6.0.3 이상이면 안전하며, 3.0.6 이상 6.0.3 미만이면 취약하므로 업그레이드가 필요하고, 출력이 없으면 해당 패키지가 설치되지 않은 것입니다.
npm ls @hapi/content 2>/dev/null | grep -E '@hapi/content@'