🇰🇷 한글 설명
Node.js의 multer 미들웨어에서 특수하게 조작된 multipart 요청을 처리할 때 발생하는 서비스 거부(DoS) 취약점입니다. 공격자가 거대한 희소 배열(sparse array)을 생성하도록 유도하면 필드 파서가 이를 동기적으로 반복 순회하면서 이벤트 루프를 차단하여 프로세스가 다른 요청을 처리할 수 없게 만듭니다.
💡 쉬운 설명
악의적인 데이터 형식을 보내 서버가 무한 루프에 빠지게 만들어 웹사이트를 마비시키는 공격입니다. 서버가 특정 작업을 처리하느라 다른 사용자의 접속을 모두 거부하게 됩니다.
🇺🇸 원문 (English)
multer is a middleware for handling multipart/form-data in Node.js. A small multipart request with two specially crafted text field names can make multer's field parser synchronously iterate a maximum-length sparse array, blocking the event loop so the process cannot handle other requests. A large numeric array index in the first field allocates a maximum-length sparse array, and a second field with a non-numeric key then triggers a full-length iteration inside the append-field dependency. All versions before 2.3.0 are affected, and this is a remotely triggerable denial of service. multer 2.3.0 adds an opt-in fieldArrayIndexLimit option that rejects oversized array indexes. Upgrade to multer 2.3.0 and set limits.fieldArrayIndexLimit to the largest array index your application needs to remediate.
📍 영향받는 시스템
multer 2.3.0 미만 모든 버전
⚔️ 공격 벡터
원격에서 특수하게 조작된 multipart/form-data 요청을 전송하여 이벤트 루프 차단
🛡️ 대응 방법
multer를 2.3.0 버전 이상으로 업그레이드하고 fieldArrayIndexLimit 옵션을 설정하여 적절한 인덱스 제한 적용
🔧 검증 코드
출력된 multer의 버전이 2.3.0 미만인지 확인합니다.