Back to Blog
high SEVERITY4 min read

How Denial of Service via Deeply Nested Field Names Happens in Node.js Multer and How to Fix It

A high-severity Denial of Service vulnerability (CVE-2026-5079) was discovered in the multer package, a popular Node.js middleware for handling multipart form data. Attackers could craft malicious requests with deeply nested field names to exhaust server resources. The fix upgrades multer from version 2.0.2 to 2.2.0, which implements proper limits on field name parsing depth.

O
By Orbis AppSec
•Published August 10, 2026•Reviewed August 10, 2026

Answer Summary

CVE-2026-5079 is a Denial of Service vulnerability in Node.js multer (versions before 2.2.0) caused by improper handling of deeply nested field names in multipart form data. The vulnerability allows attackers to send crafted requests that trigger excessive resource consumption. The fix is to upgrade multer to version 2.2.0 or later, which implements parsing depth limits to prevent the attack.

Vulnerability at a Glance

cweCWE-400 (Uncontrolled Resource Consumption)
fixUpgrade multer to version 2.2.0 which implements depth limits
riskServer unavailability, resource exhaustion, application crash
languageJavaScript/Node.js
root causeNo limit on nested field name depth in multipart form parsing
vulnerabilityDenial of Service (DoS) via Resource Exhaustion

Introduction

In the backend of this application, a high-severity Denial of Service vulnerability was lurking in backend/package-lock.json. The culprit? An outdated version of multer (version 2.0.2), the widely-used Node.js middleware for handling multipart/form-data uploads. This vulnerability, tracked as CVE-2026-5079, could have allowed attackers to crash the server by sending specially crafted requests with deeply nested field names—without even needing to authenticate.

The backend/package.json specified multer as a direct dependency:

"multer": "^2.0.2",

This version lacked critical safeguards against maliciously structured form data, creating a significant attack surface for any endpoint accepting file uploads or form submissions.

The Vulnerability Explained

What Makes Nested Field Names Dangerous?

Multer parses multipart form data, including field names like user[profile][settings][theme]. In vulnerable versions, there was no limit on how deeply these field names could be nested. An attacker could send a request with field names containing hundreds or thousands of nested brackets:

field[a][b][c][d][e][f][g][h][i][j][k][l][m][n][o][p][q][r][s][t]...

When multer attempts to parse this deeply nested structure, it recursively builds JavaScript objects. With extreme nesting depths, this process:

  1. Consumes excessive CPU cycles processing the recursive structure
  2. Exhausts memory creating deeply nested object hierarchies
  3. Blocks the event loop, preventing the server from handling other requests

Attack Scenario Specific to This Application

Consider this backend application accepting file uploads. An attacker could:

  1. Identify any endpoint using multer (file upload forms, profile picture uploads, document submissions)
  2. Craft a malicious multipart request:
POST /api/upload HTTP/1.1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary

------WebKitFormBoundary
Content-Disposition: form-data; name="data[a][b][c][d][e]...[repeated 1000 times]..."

malicious
------WebKitFormBoundary--
  1. Send multiple concurrent requests to amplify the impact
  2. The server becomes unresponsive, denying service to legitimate users

The attack requires no authentication and minimal bandwidth—a small payload can cause disproportionate resource consumption.

Real-World Impact

For this application, the consequences could include:

  • Complete service outage affecting all users
  • Cascading failures if other services depend on this backend
  • Infrastructure costs from auto-scaling triggered by the attack
  • Reputation damage from service unavailability

The Fix

The fix is straightforward but critical: upgrade multer from version 2.0.2 to 2.2.0.

Before (Vulnerable)

// backend/package.json
"multer": "^2.0.2",

After (Fixed)

// backend/package.json
"multer": "^2.2.0",

The corresponding backend/package-lock.json was also updated to lock the new version and its dependency tree.

What Changed in Multer 2.2.0?

The patched version implements:

  1. Depth limits on nested field name parsing
  2. Early termination when parsing encounters excessive nesting
  3. Configurable thresholds allowing developers to set appropriate limits for their use case

These changes ensure that even maliciously crafted requests are handled safely without exhausting server resources.

Why Both Files Changed

  • backend/package.json: Updates the version constraint to require 2.2.0+
  • backend/package-lock.json: Locks the exact resolved version and updates the dependency tree, ensuring consistent installations across environments

Key Takeaways

  • Multer versions before 2.2.0 are vulnerable to DoS via nested field names—upgrade immediately if you're using an older version
  • Small payloads can cause massive resource consumption when parsing logic lacks depth limits
  • The backend/package-lock.json file is a security-critical artifact—include it in vulnerability scans
  • Defense in depth matters: even with patched dependencies, configure explicit limits on multer options
  • Automated dependency scanning catches vulnerabilities that manual code review might miss

How Orbis AppSec Detected This

  • Source: Multipart form data field names from incoming HTTP requests
  • Sink: Multer's field name parsing logic in the vulnerable version 2.0.2
  • Missing control: No depth limit on nested field name parsing, allowing unbounded recursion
  • CWE: CWE-400 (Uncontrolled Resource Consumption)
  • Fix: Upgraded multer from 2.0.2 to 2.2.0, which implements parsing depth limits

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-5079 demonstrates how a seemingly innocent feature—nested field names in form data—can become a severe security vulnerability when proper limits aren't enforced. The fix was simple: a version bump from multer 2.0.2 to 2.2.0. But the lesson is broader: dependency management is security management.

Keep your dependencies updated, configure explicit limits even when using patched versions, and leverage automated security scanning to catch vulnerabilities before attackers do. A few minutes of proactive maintenance can prevent hours of incident response.

Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #1725

Related Articles

high

Unbounded Map in createLoginRateLimiter Exhausts API Memory

The console API's `createLoginRateLimiter` and `createMutationRateLimiter` stored one `Map` entry per client key with no upper bound and no expiry sweep, so an attacker rotating source addresses or identifiers could grow those maps until the Node process hit an out-of-memory crash. The fix introduces a `maxTrackedKeys` option (default 5000), a `trackedEntryLimit` sanitizer, and an `evictOldestIfFull` helper that drops the oldest tracked key while protecting the shared global counter. The rate li

high

js-yaml 4.3.1 Denial of Service: Malformed Input Hangs YAML Parser

A denial of service vulnerability in js-yaml versions 4.3.1 and earlier allows attackers to hang the YAML parser indefinitely by providing specially crafted malformed input. The fix, released in versions 4.3.2 and 3.15.2, patches the parsing logic to prevent unbounded processing. Upgrading is recommended for all applications parsing untrusted YAML data.

high

Express `app.get('*')` Wildcard Handler Path Traversal in watch.js

A first-party Express server's wildcard route handler used `req.url.indexOf('font.woff2')` to gate access to a font file, allowing attackers to bypass the substring check with crafted paths. The fix replaces the catch-all handler with explicit route registration.

critical

Updater.parseUpdate() CWE-494: Unsigned Metadata Download

The parseUpdate function in the Updater component extracted download URLs from remote server responses without cryptographic verification, enabling supply chain attacks via compromised or spoofed update servers. The fix adds strict URL validation requiring HTTPS and a trusted hostname before accepting any update metadata.

high

brace-expansion DoS: Exponential Backtracking in Nested Brace Patterns

A critical vulnerability in brace-expansion allows attackers to cause denial of service by submitting specially crafted patterns with nested braces. The exponential-time complexity in pattern expansion creates a computationally expensive path that can freeze applications processing user-controlled input.

high

CVE-2026-67213: nanoid customAlphabet Infinite Loop Fix

nanoid, a widely-used ID generator pulled in transitively through postcss and vitepress, had an infinite-loop bug in its `customAlphabet` code path before version 5.1.6. This PR pins the entire dependency tree to nanoid 5.1.16 via a pnpm override so no transitive consumer can resolve back to the vulnerable 3.3.16 release.