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-77063

CVE-2026-77063: File Size Limit Bypass via Asynchronous Race Condition in Multer

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 9, 2026·7 min read·17 visits

Executive Summary (TL;DR)

A race condition in multer occurs when an asynchronous fileFilter is configured alongside file size limits, allowing truncated file uploads to bypass rejection checks silently.

CVE-2026-77063 details a security flaw in multer, the standard multipart/form-data handler for Node.js, where asynchronous file filters introduce a race condition. This condition causes the library to miss file size limitation events, resulting in the silent acceptance of truncated files.

Vulnerability Overview

The Node.js library multer is a widely used middleware designed to handle multipart/form-data uploads. It typically acts as an abstraction layer built on top of busboy, which performs the low-level parsing of the incoming stream. Within standard workflows, developers rely on multer to validate file properties (such as file type) and enforce structural constraints (such as maximum file size) before storing the content.

The vulnerability, classified under CWE-362, resides in how multer coordinates the verification steps of user-supplied files against its stream processing loop. When a custom asynchronous filtering hook (fileFilter) is defined, the execution flow yields control back to the Node.js event loop. This transition introduces an asynchronous gap in the execution context.

During this gap, the network parser continues to process the file stream. If the stream exceeds the configured maximum size, the underlying parser fires a limit event. Because the event-handling hook for this size threshold is not yet attached during the asynchronous validation window, the event is lost. Consequently, the request completes without raising an error, bypassing intended size validation constraints.

Root Cause Analysis

To understand the root cause of the vulnerability, one must examine the event-driven stream parsing mechanism of the Node.js event loop. The low-level multipart parser, busboy, processes the incoming TCP stream and synchronously fires a file event as soon as a new file field is discovered. Along with this event, it passes a Readable stream representing the file payload.

Under normal circumstances with a synchronous fileFilter, the execution thread remains in the same tick of the event loop. This allows multer to evaluate the file and immediately register its internal listener for the limit event on the file stream. The registration of this listener occurs before any data is consumed from the stream, ensuring that if the threshold is breached, the event handler successfully catches the signal.

However, when the developer provides an asynchronous fileFilter (such as checking database records or validating cryptographic signatures), the execution yields. While the Promise resolves, the incoming data stream is still being ingested by busboy. If the data volume breaches the limits.fileSize threshold within this pending state, the parser fires the limit event synchronously.

Because the listener has not yet been registered, the event is emitted into an empty listener array and silently discarded. Once the asynchronous fileFilter resolves and the registration occurs, the event has already passed. The application continues processing, assuming the file did not violate the size limit constraint.

Code Analysis

The vulnerability was resolved in version 2.3.0 via commit ab6aeae650328cf31799dcfa4c3e116ba8faaacc. The core of the fix is located in the file lib/make-middleware.js where the registration timing of the stream listeners was re-architected.

Below is an annotated comparison of the vulnerable vs. patched code path:

// VULNERABLE PATH IN lib/make-middleware.js
busboy.on('file', function (fieldname, fileStream, { filename, encoding, mimeType }) {
  // ... initialization code
  if (fieldname == null) return abortWithCode('MISSING_FIELD_NAME')
 
  // Async fileFilter is executed here
  setup.fileFilter(req, file, function (err, keep) {
    if (err) return abortWithError(err)
    if (!keep) return fileStream.resume()
 
    // The 'limit' listener is attached ONLY AFTER the async filter returns
    fileStream.on('limit', function () {
      aborting = true
      abortWithCode('LIMIT_FILE_SIZE', fieldname)
    })
  })
})

In the patched version, the developers decoupled the creation of the size threshold listener from the resolution of the asynchronous verification. The listener is now established synchronously within the initial event loop tick:

// PATCHED PATH IN lib/make-middleware.js
busboy.on('file', function (fieldname, fileStream, { filename, encoding, mimeType }) {
  var pendingWritesIncremented = false
  var aborting = false
  var accepted = false
  var fileSizeLimitReached = false
 
  // Synchronously register the 'limit' listener to avoid race conditions
  fileStream.on('limit', function () {
    fileSizeLimitReached = true
    if (accepted) {
      aborting = true
      abortWithCode('LIMIT_FILE_SIZE', fieldname)
    }
  })
 
  setup.fileFilter(req, file, function (err, keep) {
    if (err) return abortWithError(err)
    if (!keep) return fileStream.resume()
 
    // Evaluate if the limit was reached while waiting for the filter to resolve
    if (fileSizeLimitReached) {
      appender.removePlaceholder(placeholder)
      return abortWithCode('LIMIT_FILE_SIZE', fieldname)
    }
 
    accepted = true
    // ... standard write handling continues
  })
})

By leveraging state-tracking flags (fileSizeLimitReached and accepted), the updated architecture ensures that even if the limit event occurs while the asynchronous call is unresolved, the state is persisted and handled immediately upon execution resumption.

Exploitation Methodology

Exploitation of CVE-2026-77063 requires three primary conditions. First, the application must be running a version of multer below 2.3.0. Second, it must configure a custom, asynchronous implementation of the fileFilter function. Third, it must set a finite fileSize limit in its validation parameters.

An attacker initiates exploitation by crafting a multi-part form-data HTTP request containing a payload larger than the application-defined fileSize limit. The attack is highly reliable when the network connection is fast, as this ensures the size limit is exceeded during the execution window of the server-side asynchronous function.

The timeline of the race condition can be visualized as follows:

When the upload completes, the server does not return a LIMIT_FILE_SIZE error. Instead, it processes the request with a 200 OK status. Although the underlying engine truncates the file to the maximum size allowed, the application logic is forced to handle partial, invalid, or corrupted files without being alerted to the validation failure.

Impact & Severity Assessment

The CVSS v3.1 score of 3.7 (Low) reflects the limited security impact of this vulnerability due to structural mitigations built into the underlying components. While the file limit validation check fails, the underlying busboy parser continues to truncate the file at the defined byte threshold. Consequently, the attack cannot be used to trigger uncontrolled memory exhaustion or fill server disks with arbitrary data.

The real impact is situated in application-level data integrity and functional bypasses. Systems relying on the strict rejection of over-sized files to avoid processing errors will accept truncated files. For example, if an application enforces a 10MB limit on image uploads, an attacker could upload an over-sized or malformed image that is processed as a truncated file, potentially causing downstream processing libraries to fail, hang, or execute logic errors.

Additionally, applications that expect atomic write operations (where a file is either completely valid and stored, or rejected entirely) will suffer from corrupted application states. This can lead to database inconsistencies, where metadata records point to broken or incomplete file resources on disk.

Remediation & Detection Guidance

The primary recommendation to mitigate CVE-2026-77063 is to upgrade the multer dependency to version 2.3.0 or higher. This upgrade ensures that size limit listeners are registered synchronously, correcting the race condition across all asynchronous processing paths.

For environments where upgrading is not immediately possible, developers must refactor the file filter hooks to run synchronously. Any validation requiring asynchronous resources (such as database lookups, third-party API queries, or hash computations) should be moved out of the multer execution flow. The application should instead validate the file after the middleware has successfully processed and temporarily stored the payload, deleting the file manually if downstream checks fail.

To detect vulnerable code patterns across enterprise codebases, security teams can employ Static Application Security Testing (SAST) rules. The following Semgrep pattern identifies multer initializations that integrate both file size limits and asynchronous validation handlers:

rules:
  - id: multer-async-filefilter-race
    languages: [javascript, typescript]
    severity: WARNING
    message: "Detected an asynchronous fileFilter used with a configured fileSize limit. This setup is vulnerable to size-limit bypass (CVE-2026-77063)."
    patterns:
      - pattern-either:
          - pattern: |
              multer({
                ...,
                fileFilter: async function (...) { ... },
                ...,
                limits: { ..., fileSize: $VAL, ... }
              })
          - pattern: |
              multer({
                ...,
                fileFilter: (...) => { ... return new Promise(...); },
                ...,
                limits: { ..., fileSize: $VAL, ... }
              })

Official Patches

OpenJS FoundationGitHub commit fixing the asynchronous event registration logic.

Fix Analysis (1)

Technical Appendix

CVSS Score
3.7/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS Probability
0.16%
Top 95% most exploited

Affected Systems

Applications utilizing multer with configured fileSize limits and custom asynchronous fileFilter hooks.

Affected Versions Detail

Product
Affected Versions
Fixed Version
multer
OpenJS Foundation
< 2.3.02.3.0
AttributeDetail
CWE IDCWE-362
Attack VectorNetwork (AV:N)
CVSS v3.13.7 (Low)
EPSS Score0.00160
Exploit StatusProof of Concept available in codebase tests
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1068Exploitation for Privilege Escalation
Privilege Escalation
CWE-362
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

The product runs code that uses shared resources in a concurrent manner, allowing unexpected execution paths or timings to bypass security boundaries.

Known Exploits & Detection

GitHubAdvisory context containing PoC references within test modules.

References & Sources

  • [1]GitHub Security Advisory GHSA-qvfw-j98x-7q72
  • [2]OpenJS Security Advisories Listing
  • [3]NVD Vulnerability Details CVE-2026-77063

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

•35 minutes ago•CVE-2026-46429
5.5

CVE-2026-46429: Unrestricted File Upload and Validation Bypass in GeoNode

GeoNode versions prior to 5.0.3 contain an unrestricted file upload vulnerability (CWE-434) within the document and dataset ingestion architecture. Authenticated low-privileged users can bypass upload validation via direct REST API interactions, file extension masquerading, metadata mutation via PATCH requests, or malicious archive submissions. This allows attackers to store and serve dangerous file types, alter on-disk file references, or trigger path traversal and resource exhaustion during archive extraction.

Amit Schendel
Amit Schendel
1 views•10 min read
•about 2 hours ago•CVE-2026-55649
6.3

CVE-2026-55649: Stored Cross-Site Scripting in GeoNode Document Metadata Abstract Field

CVE-2026-55649 is a stored Cross-Site Scripting (XSS) vulnerability in GeoNode versions prior to 5.0.3. The flaw exists because document abstract metadata fields are ingested via the metadata management pipeline and stored in the backend database without HTML sanitization or input neutralization. An authenticated attacker with privileges to create or edit document metadata can inject arbitrary HTML and JavaScript payloads into these fields. When another user, such as an administrator, views the affected document page or catalog listing, the unencoded payload is rendered into the Document Object Model (DOM) and executes within the victim's browser session.

Amit Schendel
Amit Schendel
4 views•9 min read
•about 3 hours ago•GHSA-QX75-2P3R-PWM5
7.7

CVE-2026-55622: Cross-Project Instance Copy Authorization Bypass in Canonical LXD and LXC Incus

CVE-2026-55622 (GHSA-qx75-2p3r-pwm5) is an improper access control vulnerability (CWE-284) in Canonical LXD and LXC Incus (tracked as GHSA-c9f5-j9c3-mhrg). In multi-tenant deployments utilizing project-based isolation, the REST API handler for instance creation via POST /1.0/instances verifies that the authenticated user has authorization in the destination project specified by the query parameter, but fails to verify whether the user holds read or view permissions for the source instance when executing a copy operation across projects. Consequently, an authenticated client restricted to a single project can clone instances or snapshots from unauthorized projects into their own project, resulting in complete disclosure of the target instance filesystem and embedded credentials.

Amit Schendel
Amit Schendel
3 views•11 min read
•about 4 hours ago•GHSA-7MR3-28H5-M5VX
7.7

GHSA-7mr3-28h5-m5vx: Authorization Bypass and Cross-Project Volume Copy in Canonical LXD

An authorization bypass vulnerability in Canonical LXD (tracked as GHSA-7mr3-28h5-m5vx and CVE-2026-55621, and as GHSA-64f3-v33m-w89f in Linux Containers Incus) allows an authenticated user with restricted project access to copy custom storage volumes and volume snapshots from unauthorized projects. The flaw resides in the storagePoolVolumesPost REST API handler, which verifies permissions on the destination project but fails to check whether the caller holds view entitlements on the source project or volume specified in the request body.

Alon Barad
Alon Barad
3 views•10 min read
•about 5 hours ago•GHSA-47W9-6R3F-938G
9.9

GHSA-47w9-6r3f-938g: Authorization Bypass and Host Root Command Execution in Canonical LXD and Incus

A missing authorization and configuration validation vulnerability in Canonical LXD and LXC Incus allows authenticated users within restricted projects to bypass project security boundaries. By smuggling prohibited low-level configuration directives (such as raw.lxc or raw.qemu) inside instance snapshots or backup archives, an attacker can restore these configurations within a restricted project and execute arbitrary commands with root privileges on the underlying host operating system.

Alon Barad
Alon Barad
4 views•11 min read
•about 6 hours ago•GHSA-JPF8-86F3-WP38
9.9

CVE-2026-48752: Arbitrary Host File Read and Write via Templates Symlink in Canonical LXD and Incus

A symbolic link traversal vulnerability (CWE-59) in Canonical LXD and Linux Containers Incus allows an authenticated user with image import permissions to read and write arbitrary files on the host filesystem. During image archive unpacking, the daemon fails to reject top-level symbolic links for the instance `templates` directory. Subsequent requests to the instance template API endpoints follow this symbolic link outside the instance storage directory with root privileges, enabling complete host compromise.

Amit Schendel
Amit Schendel
4 views•10 min read