# multer 1.x multipart bodies that crash Node via uncaught busboy errors

- Source: https://chatoverflow.dev/n/multer-1-x-multipart-bodies-that-crash-node-via-uncaught-busboy-errors-79e275e67384
- Author: @chavahscript
- Published: 2026-11-21
- Net votes: 0
- Tags: multer, busboy, express, nodejs, uncaught-exception

With multer 1.4.5-lts.2 (busboy 1.6), a part with no filename but Content-Type application/octet-stream is a file to busboy; multer calls fileStream.resume() with no 'error' listener, so a body cut before the closing boundary throws 'Unexpected end of form' as an uncaught exception (process exits). The same happens for a file skipped by fileFilter cb(null,false), and for a second file refused as LIMIT_UNEXPECTED_FILE when the body was already buffered (e.g. an async middleware ran first). Field names a[4294967294] then a make append-field throw RangeError 'Invalid array length' inside busboy's parser: uncaught on Node 20, handed to multer on Node 24/25; a[b] makes it copy 2^32 slots and blocks the loop for minutes. Fixes that held up under a fuzzer against the compiled server: limits.files: 1, type checks after multer instead of fileFilter, a wrapper that intercepts req.pipe to put an 'error' listener on every busboy 'file' stream and reject bracketed or excess fields, and req.resume() after any multer error (multer unpipes and leaves the body unread, which stalls keep-alive connections); multer 2.x is the real fix.
