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, 2026Reviewed 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

Prevention & Best Practices

1. Keep Dependencies Updated

Regularly audit and update your dependencies. Use tools like:

npm audit
npm outdated

2. Implement Defense in Depth

Even with updated dependencies, add additional protections:

const multer = require('multer');

const upload = multer({
  limits: {
    fieldNameSize: 100,     // Max field name size
    fieldSize: 1024 * 1024, // Max field value size (1MB)
    fields: 10,             // Max number of non-file fields
    fileSize: 5 * 1024 * 1024, // Max file size (5MB)
    files: 5,               // Max number of files
    parts: 20               // Max number of parts (fields + files)
  }
});

3. Use Rate Limiting

Protect upload endpoints with rate limiting:

const rateLimit = require('express-rate-limit');

const uploadLimiter = rateLimit({
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 100 // limit each IP to 100 requests per window
});

app.use('/api/upload', uploadLimiter);

4. Monitor for Anomalies

Implement monitoring to detect unusual patterns:
- Sudden spikes in request processing time
- Memory usage anomalies
- High CPU utilization on upload endpoints

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.

References

Frequently Asked Questions

What is a Denial of Service vulnerability?

A Denial of Service (DoS) vulnerability allows attackers to make a system or application unavailable to legitimate users by exhausting its resources such as CPU, memory, or network bandwidth.

How do you prevent DoS vulnerabilities in Node.js?

Implement input validation, set limits on request sizes and parsing depth, use rate limiting, keep dependencies updated, and employ timeout mechanisms for resource-intensive operations.

What CWE is resource exhaustion DoS?

CWE-400 (Uncontrolled Resource Consumption) covers vulnerabilities where an application does not properly restrict the amount of resources consumed, leading to denial of service.

Is input size validation enough to prevent DoS attacks?

No, size validation alone is insufficient. Attackers can craft small payloads with complex structures (like deeply nested fields) that consume disproportionate resources during parsing, bypassing size limits.

Can static analysis detect DoS vulnerabilities?

Yes, static analysis tools like Trivy can detect known vulnerable dependency versions. However, detecting novel DoS patterns often requires dynamic analysis, fuzzing, and security audits.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #1725

Related Articles

critical

How Sensitive Data Exposure in Error Logging happens in TypeScript/Deno and how to fix it

A critical vulnerability in Supabase Edge Functions allowed sensitive authentication errors and API credentials to leak through verbose error logging. The `cancel-subscription/index.ts` function logged full error objects to the console, potentially exposing Paddle API keys and auth tokens in deployment logs. The fix sanitizes all error messages to log only safe error text while preserving debugging capability.

critical

How HTTP Header Injection Happens in Go and How to Fix It

A critical vulnerability in the file upload handler allowed attackers to inject CRLF sequences into HTTP response headers through crafted filenames. The fix sanitizes user-supplied filenames before using them in Content-Disposition headers, preventing header injection attacks that could lead to cache poisoning, session fixation, or XSS.

high

How Path Traversal and Security Policy Bypass Happens in Node.js Dependencies and How to Fix It

A high-severity vulnerability in the fast-uri package (CVE-2026-6321) allowed attackers to bypass security policies through improper Unicode hostname canonicalization and path traversal. This issue affected the @apralabs/apra-fleet project through its dependency tree, and was resolved by upgrading fast-uri from version 3.1.0 to 4.1.2 using npm overrides.

high

How Command Injection happens in Node.js child_process calls and how to fix it

A high-severity command injection vulnerability was discovered in `tools/utils/lang/helpers.ts` where the `prettier()` function passed a user-controllable `fileName` argument directly into a shell command string via `exec()`. By replacing `exec()` with `execFile()` and passing arguments as an array, the fix eliminates shell interpolation entirely, preventing attackers from injecting arbitrary shell commands through malicious filenames.

high

How Quadratic CPU Consumption in YAML Parsing happens in JavaScript and how to fix it

A high-severity vulnerability in js-yaml versions 3.x and 4.x allowed attackers to cause quadratic CPU consumption through specially crafted YAML documents using the `!!omap` type. This denial-of-service vulnerability (GHSA-5p4m-2wfm-xmqj) was fixed by upgrading from js-yaml 4.3.0 to 4.3.1, protecting applications from algorithmic complexity attacks during YAML parsing.

high

How Arbitrary HTTP Header Injection via Prototype Pollution happens in JavaScript and how to fix it

A high-severity vulnerability (CVE-2026-42035) in axios version 1.13.5 allowed attackers to inject arbitrary HTTP headers through prototype pollution. The fix upgrades axios to version 1.18.0 in the frontend's dependency tree, which includes proper prototype chain validation when constructing HTTP request headers. This prevents attackers from manipulating outgoing requests to perform SSRF, session hijacking, or cache poisoning attacks.