CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-5038

CVE-2026-5038: Denial of Service via Incomplete File Cleanup in Multer diskStorage Engine

Amit Schendel
Amit Schendel
Senior Security Researcher

Jun 17, 2026·7 min read·109 visits

Executive Summary (TL;DR)

Unauthenticated remote attackers can exhaust server disk space and cause Denial of Service by initiating and aborting file uploads in Multer's diskStorage engine, leaving un-tracked, orphaned temporary files on the disk.

CVE-2026-5038 is a critical denial of service vulnerability in the Node.js Multer middleware. When utilizing the diskStorage engine, connection termination or validation failures leave partial files orphaned on the local filesystem due to stream-destruction signal propagation failures in Node's piping mechanism. Remote unauthenticated attackers can exploit this to fill server disks and induce system crashes.

Vulnerability Overview

The node-package multer is a standard Node.js multipart parser middleware designed to handle multipart/form-data request bodies, predominantly utilized for processing incoming user file uploads. This package provides developers with multiple built-in storage engines, including a memory storage driver and a disk storage driver (diskStorage). When configured to use diskStorage, the middleware is responsible for streaming file payloads directly to the host filesystem as they are received, preventing high memory utilization during large file transfers.

This architecture introduces a critical attack surface. Because the application accepts external network streams and maps them directly to filesystem writes, it relies heavily on robust stream lifecycle management to clean up incomplete or aborted operations. Under standard configurations, the middleware fails to handle abrupt termination of incoming streams.

This vulnerability is classified under CWE-459 (Incomplete Cleanup). When an upload process is disrupted before completion, the physical file fragments remain written to disk without registry, leaving the system highly exposed to denial of service attacks through automated storage exhaustion.

Root Cause Analysis

The root cause of this flaw lies in Node.js stream-piping mechanics combined with Multer's lazy tracking strategy. Inside the vulnerable engine implementation located in storage/disk.js, Multer instantiates an output file stream and binds the input stream via standard piping:

var outStream = fs.createWriteStream(finalPath)
file.stream.pipe(outStream)

In Node.js, calling Readable.pipe(Writable) facilitates data transfer from a reader source to a writer target. However, the standard implementation of pipe() does not propagate destruction or error events from the readable source down to the writable target. If the source stream experiences an abrupt disconnection, the destination writable stream is left in a dangling state rather than being terminated and garbage collected.

When a client aborts the TCP connection mid-upload, or when an input validation boundary limits the payload, the source file.stream is destroyed. Because the destruction signal is not propagated, the target write-stream (outStream) remains unclosed. Furthermore, Multer previously tracked active uploads only after successful completion inside the storage._handleFile() callback. Failed uploads never invoked this callback, excluding them from the uploadedFiles tracking array used by the clean-up routines. Consequently, these partial files remain on the storage unit permanently.

Code Analysis and Patch Evaluation

To resolve the leak, the maintainers modified both the middleware manager and the disk storage engine. The update introduces active tracking of 'in-flight' (pending) file uploads, ensuring that physical file boundaries are declared and tracked prior to stream allocation.

In the patched version of lib/make-middleware.js, a new pendingFiles array is registered alongside uploadedFiles. When file parsing commences, the file structure is pushed to this array immediately. If an error or abort cycle is triggered, both active and pending arrays are merged for cleanup:

@@ -35,6 +35,7 @@ function makeMiddleware (setup) {
     var errorOccured = false
     var pendingWrites = new Counter()
     var uploadedFiles = []
+    var pendingFiles = []
 
     function done (err) {
       var called = false
@@ -82,7 +83,12 @@ function makeMiddleware (setup) {
           storage._removeFile(req, file, cb)
         } 
-
-        removeUploadedFiles(uploadedFiles, remove, function (err, storageErrors) {
+        var filesToRemove = uploadedFiles.concat(
+          pendingFiles.filter(function (f) { return f.path })
+        )
+        pendingFiles = []
+
+        removeUploadedFiles(filesToRemove, remove, function (err, storageErrors) {

Additionally, storage/disk.js was modified to populate the absolute path before data pipe configuration begins. This alteration permits the cleanup daemon to recognize the exact physical target on disk, even if the write stream fails to finalize:

@@ -34,8 +34,13 @@ DiskStorage.prototype._handleFile = function _handleFile (req, file, cb) {
       if (err) return cb(err) 
       var finalPath = path.join(destination, filename)
+
+      if (file.stream.destroyed) return
+
       var outStream = fs.createWriteStream(finalPath)
 
+      file.path = finalPath
+
       file.stream.pipe(outStream)

Evaluating the patch completeness reveals a critical limitation on Windows systems. In Windows, trying to unlink an active file handle which hasn't fully closed results in EPERM or EBUSY exceptions. If the execution environment attempts to delete the orphaned path before Node's runtime releases the underlying file descriptor, the deletion routine will fail, meaning files can still leak on Windows deployments.

Exploitation Methodology

Exploitation requires no special privileges or authenticated sessions. An attacker only needs to locate an endpoint within the target application that processes multipart uploads using Multer's disk storage engine. There are no application-specific logic hurdles required to execute the attack.

The attack begins by starting a valid multi-part HTTP POST request containing a large payload boundary. Once the target server starts receiving the boundary and instantiates the write stream on the local disk, the attacker terminates the socket TCP connection abruptly before sending the final multi-part delimiter. By executing this loop concurrently, an attacker can quickly exhaust the file storage of the host.

The official test suite test/orphan-file-cleanup.js replicates this sequence. It starts a server, sends partial headers, transfers a singular chunk of data, and destroys the socket immediately via req.destroy(). In vulnerable setups, the temporary directory retains the partial upload fragment permanently.

// Inside the reproduction harness
var req = http.request({
  hostname: 'localhost',
  port: port,
  path: '/upload',
  method: 'POST',
  headers: {
    'Content-Type': 'multipart/form-data; boundary=' + boundary,
    'Content-Length': 655360
  }
});
req.write(preamble);
req.write(chunk);
// Abort socket execution mid-stream
setTimeout(() => {
  req.destroy();
}, 50);

Operational Impact Assessment

The operational impact of this vulnerability is high, specifically regarding the availability of the host application and underlying operating system. Because temporary files accumulate inside the system directory indefinitely, malicious actors can fully exhaust the disk space of the target storage partition.

When a partition runs out of free space, the system behavior degrades. Database engines running on the same host may suffer from silent transaction rollbacks, write failures, or immediate database corruption. The Node.js application process itself will fail to allocate space for essential session states, log files, or localized caching engines, ultimately resulting in application failure.

The CVSS score is rated at 5.3 (Medium). This severity categorization is low primarily because of standard CVSS criteria which do not factor in the cascading OS-level failures that occur during complete storage depletion. In real-world production environments, storage exhaustion creates immediate, widespread service outages.

Remediation and Mitigation

The primary remediation path is upgrading the multer package dependency to patched versions. For applications on the 2.x development branch, update to version 2.2.0. For environments relying on 3.x pre-releases, migrate to 3.0.0-alpha.2.

In scenarios where immediate updates are not feasible, network and environmental mitigations can restrict exploitation capabilities. Implementing directory storage quotas prevents the application from filling up partitions shared with the core OS or database storage engines.

Upstream reverse proxies such as NGINX or Web Application Firewalls should be configured to enforce strict timeout parameters and limit incoming payload sizes. This ensures that massive upload requests are terminated prior to reaching the Node.js application layer.

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.28%
Top 81% most exploited

Affected Systems

Node.js web servers utilizing Multer with diskStorage configuration

Affected Versions Detail

Product
Affected Versions
Fixed Version
multer
OpenJS Foundation
>= 2.0.0-alpha.1, < 2.2.02.2.0
multer
OpenJS Foundation
>= 3.0.0-alpha.1, < 3.0.0-alpha.23.0.0-alpha.2
AttributeDetail
CWE IDCWE-459 (Incomplete Cleanup)
Attack VectorNetwork (AV:N)
Attack ComplexityLow (AC:L)
EPSS Score0.00278 (19.40th Percentile)
Exploit StatusProof-of-Concept Available
CISA KEV StatusNot Listed
Impact ClassDenial of Service (DoS)

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-459
Incomplete Cleanup

The software does not clean up all temporary or administrative files that are generated during its execution, which can consume storage resources over time.

Vulnerability Timeline

Vulnerability published to NVD database
2026-06-15
OpenJS Foundation releases formal patch specifications
2026-06-15
OSV database metrics updated to reflect semantic version ranges
2026-06-17

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•6 minutes ago•CVE-2026-105644
6.8

CVE-2026-105644: Stored Cross-Site Scripting via Malicious SVG Content Import in Ghost CMS

A Stored Cross-Site Scripting (XSS) and Unrestricted Upload of File with Dangerous Type vulnerability in Ghost CMS (versions 4.0.0 to 6.66.x) allows remote attackers to execute arbitrary JavaScript in the context of an administrator's session. The flaw lies in the content import subsystem, which extracted and stored SVG files without sanitization or binary verification.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 1 hour ago•CVE-2026-105643
7.3

CVE-2026-105643: Stored Cross-Site Scripting and Isolation Bypass in Ghost CMS

Stored Cross-Site Scripting (XSS) and origin isolation bypass vulnerability in Ghost CMS versions 6.34.0 through 6.66.1 allows low-privileged staff users to execute arbitrary JavaScript in the context of an administrator session via crafted embed cards.

Alon Barad
Alon Barad
4 views•6 min read
•about 2 hours ago•CVE-2026-105642
8.8

CVE-2026-105642: Remote Code Execution in Ghost CMS via Unsafe SVG Processing during Metadata Scraping

CVE-2026-105642 is a critical remote code execution vulnerability in Ghost CMS, affecting versions 6.56.0 through 6.66.0. The flaw resides in how Ghost's backend handles external image metadata when generating 'Bookmark' cards in the post editor. When a low-privileged staff member inputs a malicious URL, the server fetches and processes an SVG containing an embedded payload, leading to command execution via the underlying, vulnerable image-processing component.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 3 hours ago•CVE-2026-61439
7.5

CVE-2026-61439: Prompt Injection Defense Bypass in PraisonAI InjectionDefense Engine

This report provides a comprehensive technical analysis of CVE-2026-61439 (GHSA-fj8f-m44g-c479), a prompt injection defense bypass vulnerability in the PraisonAI multi-agent framework. In versions prior to 4.6.78, the InjectionDefense scanner threshold defaulted to CRITICAL. This allowed single-vector prompt injections classified as HIGH severity (e.g., direct instruction overrides or financial manipulations) to pass through unblocked, enabling attackers to extract system prompts and execute unauthorized agent tools.

Alon Barad
Alon Barad
5 views•7 min read
•about 4 hours ago•CVE-2026-104890
7.2

CVE-2026-104890: Remote Code Execution via Mixed-Case File Upload Bypass in Kunstmaan CMS MediaBundle

Kunstmaan CMS MediaBundle prior to version 7.3.2 contains a critical file upload vulnerability where case-sensitive extension checks can be bypassed using mixed-case file extensions. Because extension normalization occurs after the validation routine, files with mixed-case executable extensions (such as pHp) bypass checks but are stored with normalized lowercase executable extensions, allowing authenticated administrators to achieve remote code execution.

Amit Schendel
Amit Schendel
10 views•6 min read
•about 5 hours ago•CVE-2026-106443
8.8

CVE-2026-106443: Remote Code Execution in WeasyPrint via Unvalidated Pillow EPS Processing

A critical remote code execution vulnerability was identified in WeasyPrint prior to version 70.0. When compiling HTML containing a malicious Encapsulated PostScript (EPS) graphic on a host with Ghostscript installed, Pillow invokes Ghostscript to process the image, executing arbitrary PostScript commands.

Amit Schendel
Amit Schendel
7 views•8 min read