🇰🇷 한글 설명
Node.js용 multer 미들웨어의 2.0.0 버전부터 2.5.0 미만 버전에서 비동기 fileFilter를 사용할 때 발생하는 취약점입니다. 파일 업로드 요청이 비동기 필터링 중에 중단되면, 이미 종료된 스트림에 에러가 발생하여 Node.js 프로세스가 예기치 않게 종료될 수 있습니다.
💡 쉬운 설명
파일을 올리는 도중에 연결을 끊어버리면 서버 프로그램이 오류를 견디지 못하고 갑자기 꺼져버리는 문제입니다. 이로 인해 서비스가 중단될 수 있습니다.
🇺🇸 원문 (English)
multer is a middleware for Node.js that handles multipart/form-data file uploads. In versions from 2.0.0 before 2.5.0, when multer is configured with an asynchronous fileFilter, a single request can crash the Node.js process. If the request is aborted while one file's asynchronous fileFilter is still pending, the pending callback later resumes a parsing stream that multer has already torn down, and the underlying parser emits an error on a stream that no longer has an error listener, which Node raises as an unhandled error event so the process exits. Any application using multer with an asynchronous fileFilter is affected regardless of storage engine, while uploads using a synchronous fileFilter are not affected. The issue is fixed in multer 2.5.0, and users should upgrade to 2.5.0 or later. As a workaround, use a synchronous fileFilter.
📍 영향받는 시스템
multer versions 2.0.0 to < 2.5.0 (using asynchronous fileFilter)
⚔️ 공격 벡터
비동기 fileFilter가 실행 중인 상태에서 업로드 요청을 강제로 중단(Abort)시켜 프로세스 충돌 유도
🛡️ 대응 방법
multer를 2.5.0 이상의 버전으로 업그레이드하거나, fileFilter를 동기(synchronous) 방식으로 변경
🔧 검증 코드
출력된 multer의 버전이 2.5.0 미만인지 확인합니다.
npm list multer | grep multer