CVE-2026-5038: multer Denial of Service via Orphaned Upload Files
multer, a popular Node.js middleware for handling file uploads, has a resource exhaustion vulnerability affecting versions 2.0.0-alpha.1 through 2.1.1 and 3.0.0-alpha.1. When a multipart upload is aborted or arrives malformed, the library fails to clean up temporary partial files from disk. An unauthenticated attacker can repeatedly trigger these failed uploads to consume disk space until the server runs out, causing a denial of service. No special application code flaws are needed—the vulnerability is inherent to how multer manages stream cleanup.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Weaknesses (CWE)
- CWE-459
- Affected products
- 2 configuration(s)
- Published / Modified
- 2026-06-15 / 2026-06-17
NVD description (verbatim)
Impact: multer versions 2.0.0-alpha.1 through 2.1.1 and 3.0.0-alpha.1 are vulnerable to a Denial of Service when using diskStorage. Aborted or malformed multipart uploads leave orphaned partial files on disk because the Readable.pipe() call does not propagate the stream destroy signal to the underlying fs.WriteStream. An attacker can exhaust disk space by triggering many aborted uploads, with no application bug required. Patches: Users should upgrade to multer 2.2.0 (2.x line) or 3.0.0-alpha.2 (3.x prerelease). Both versions track in-flight write streams and clean them up on the abort path. Workarounds: None.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from improper stream lifecycle management in multer's diskStorage implementation. When a readable stream is piped to an fs.WriteStream, the Readable.pipe() call does not automatically propagate the destroy signal downstream in all failure modes. During an aborted multipart upload (such as a client disconnect or malformed Content-Length header), the write stream is never destroyed or cleaned up. Orphaned partial files accumulate on the file system. Because disk I/O operations are relatively fast compared to network transmission, an attacker can sustain a high rate of aborted uploads to exhaust available disk space, triggering application errors or complete unavailability.
Business impact
Applications using affected multer versions will experience progressive disk exhaustion leading to service degradation or outage. File upload functionality fails, application logs fill with I/O errors, and in constrained environments (containerized deployments, cloud instances with fixed storage), the entire application may become unavailable within hours of sustained attack. Recovery requires manual cleanup of orphaned files and server restart. Organizations relying on multer for user file submissions, document handling, or media ingestion face reputational and revenue impact proportional to upload traffic.
Affected systems
multer 2.0.0-alpha.1 through 2.1.1 (stable 2.x line) and 3.0.0-alpha.1 (early prerelease 3.x) are vulnerable when diskStorage is configured. Applications using multer with memory storage or custom storage implementations are not affected. The vulnerability applies to any Node.js/Express application that accepts multipart uploads and has not upgraded to patched versions.
Exploitability
This vulnerability is trivial to exploit. An attacker requires no authentication, no special upload content, and no application-level bugs. Simple HTTP requests with incomplete multipart payloads (e.g., early connection termination, invalid headers) trigger orphaned file creation. The attack is network-accessible and scales horizontally—a single attacker or botnet can sustain high request rates to exhaust disk resources. There is no user interaction required. Automated scanning and exploitation are straightforward.
Remediation
Upgrade immediately to multer 2.2.0 (for the 2.x stable line) or 3.0.0-alpha.2 (for the 3.x prerelease). Both patched versions implement stream tracking and destroy all in-flight write streams on the abort path, eliminating orphaned files. If immediate upgrade is infeasible, no reliable workaround exists—application-level stream management cannot fully compensate. Consider temporarily disabling file upload features or rate-limiting upload endpoints as a temporary mitigation only.
Patch guidance
Verify your current multer version using `npm list multer` or check package-lock.json. If running 2.0.0-alpha.1 through 2.1.1, upgrade to 2.2.0 via `npm update multer` or `npm install [email protected]`. If running 3.0.0-alpha.1, upgrade to 3.0.0-alpha.2. Test file upload and abort scenarios in a staging environment to confirm cleanup behavior. Review any custom middleware or stream-handling code that may interact with multer's internal streams. Restart applications after dependency update.
Detection guidance
Monitor disk usage trends on application servers running multer, particularly spikes during periods of failed or aborted uploads. Check file system logs for rapid creation of temporary files in multer's designated upload directory (often /tmp or a configured path). Correlate upload endpoint access logs with disk growth—sustained GET or POST requests to upload endpoints without successful completions indicate attack activity. Implement alerts on disk utilization thresholds and watch for accumulation of partial or zero-byte files with recent modification times. Log all multipart upload failures and abort events at the application level.
Why prioritize this
Although CVSS 5.3 (MEDIUM) reflects limited scope, this vulnerability poses significant operational risk. Denial of service attacks are particularly damaging in production environments, and disk exhaustion can cascade to affect other services sharing the same storage. The vulnerability is trivial to exploit, requires no privileges, and can be triggered by any untrusted source sending multipart uploads. Organizations with externally facing file upload endpoints should prioritize patching within days, not weeks. Internal-only upload services can be deprioritized slightly but should not be deferred indefinitely.
Risk score, explained
The CVSS 3.1 score of 5.3 (MEDIUM) reflects a network-accessible denial of service with low complexity and no privileges required, but limited scope (availability only—no confidentiality or integrity impact). The score does not capture the ease of exploitation or the operational criticality of file upload functionality in many applications. Organizations should weigh their reliance on multer-based uploads and their tolerance for downtime when assessing true risk. High-availability deployments or user-facing services should treat this as HIGH priority despite the MEDIUM CVSS rating.
Frequently asked questions
Can I detect if my application has been exploited by this vulnerability?
Yes. Check for orphaned temporary files in your multer upload directory (identify this path from your application configuration). Scan for partial files without corresponding completed uploads—these are strong indicators of attack or accidental aborts. Review access logs for unusual rates of upload requests without successful completions, especially from suspicious IP ranges. Disk usage patterns showing rapid growth followed by the accumulation of small files also suggest exploitation.
Does this vulnerability require the attacker to authenticate or be inside my network?
No. The vulnerability is network-accessible (AV:N) and requires no authentication (PR:N). Any attacker on the internet who can reach your file upload endpoint can trigger it by sending malformed or incomplete multipart requests. No special privileges or internal knowledge are needed.
Are there any safe deployment practices if I cannot immediately upgrade?
Implement aggressive rate limiting on upload endpoints to slow disk exhaustion and give you time to detect the attack. Monitor disk space in real time and set up automated alerts. Disable file uploads temporarily if attacks occur. Use a separate disk or volume for uploads to isolate the impact. However, these are temporary measures only—patching should remain the priority.
If I use multer with a custom storage backend instead of diskStorage, am I affected?
No. The vulnerability is specific to multer's built-in diskStorage implementation. Custom storage backends (such as S3, cloud storage, or database-backed solutions) are not affected, provided you have not replicated the same stream cleanup bug in your custom code.
This analysis is based on the vulnerability disclosure as of 2026-06-17. Verify all patch versions and availability against the official multer GitHub repository and npm registry before deploying. CVSS scores reflect technical characteristics only and should not be the sole basis for prioritization decisions. Organizations should assess their own risk tolerance, upload traffic patterns, and business criticality of file handling functions. This intelligence is provided for educational and defensive purposes; it does not constitute legal advice or a guarantee of exploit or impact in your specific environment. Source: NVD (public-domain), retrieved 2026-07-24. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-53867MEDIUMCapgo Profile Image Deletion Vulnerability
- CVE-2026-5079HIGHMulter Denial of Service via Nested Field Names
- CVE-2016-20064MEDIUMWP Vault 0.8.6.6 Arbitrary File Read via Directory Traversal
- CVE-2016-20067MEDIUMWordPress CP Polls CSRF Vulnerability
- CVE-2016-20070MEDIUMPrivilege Escalation & Stored XSS in WordPress Booking Calendar Contact Form 1.0.23
- CVE-2016-20074MEDIUMWordPress Lazy Content Slider CSRF Vulnerability – Patch & Detection Guide
- CVE-2016-20077MEDIUMWordPress Photocart Link Plugin Local File Inclusion Vulnerability
- CVE-2016-20078MEDIUMWordPress IMDb Profile Widget Local File Inclusion Vulnerability