Skip to main content
Vulnerability Database/CVE-2026-111181

CVE-2026-111181: body-parser Node.js DoS Vulnerability

CVE-2026-111181 is a denial of service vulnerability in body-parser middleware for Node.js that allows attackers to crash applications with a single malformed request. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111181 Overview

CVE-2026-111181 is a denial-of-service vulnerability in body-parser, the request body parsing middleware for Node.js and Express. A single crafted HTTP request can crash any application that uses body-parser with default options. The flaw affects versions prior to 1.20.9 and versions from 2.0.0 up to but not including 2.4.0. Because body parsing runs before routing, every endpoint that accepts a request body is exposed, regardless of path or authentication state. The issue is tracked under [CWE-248: Uncaught Exception].

Critical Impact

An unauthenticated remote attacker can terminate the Node.js process with one HTTP request, producing a full application outage with trivial effort.

Affected Products

  • body-parser versions prior to 1.20.9
  • body-parser versions 2.0.0 through 2.3.x (fixed in 2.4.0)
  • Any Node.js or Express application using body-parser with default inflation enabled

Discovery Timeline

  • 2026-10-22 - CVE-2026-111181 published to the National Vulnerability Database
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-111181

Vulnerability Analysis

The vulnerability resides in how body-parser handles compressed request bodies. When a request arrives with a Content-Encoding header such as gzip, deflate, or br, the middleware pipes the raw body into a Node.js decompression stream. After the body is read, the middleware does not attach an error listener to the decompression stream. The decoder is left dangling with no handler for subsequent error events.

An attacker sends a payload containing one valid compressed frame followed by trailing bytes. The first frame decodes successfully and the application returns a normal response. The trailing bytes then reach the already-finished decoder, which emits an error. Because no listener is attached, Node.js converts the event into an uncaught exception and terminates the process.

Root Cause

The root cause is missing error handling on the decompression stream used by the inflate code path. Node.js stream error events must be consumed; otherwise the runtime treats them as fatal. The middleware completes the request lifecycle before the trailing data is processed, leaving the stream alive but unobserved.

Attack Vector

Exploitation requires only network access to any HTTP endpoint that parses a body. The attacker sets Content-Encoding: gzip and sends a payload consisting of a valid gzip frame concatenated with arbitrary trailing bytes. No authentication, user interaction, or matching route is required, since body-parser executes earlier in the Express middleware chain than the router. See the GitHub Security Advisory GHSA-27r3-jxmh-p828 for technical details.

Detection Methods for CVE-2026-111181

Indicators of Compromise

  • Unexpected Node.js process termination with uncaughtException entries referencing zlib or decompression stream internals in stderr or process-manager logs.
  • Request logs showing HTTP requests with Content-Encoding: gzip, deflate, or br immediately preceding a process restart event from pm2, systemd, or a container orchestrator.
  • Repeated application restarts tied to the same source IP sending compressed POST or PUT requests.

Detection Strategies

  • Inventory running Node.js services and resolve the installed body-parser version using npm ls body-parser to identify vulnerable deployments.
  • Scan dependency manifests (package-lock.json, yarn.lock, pnpm-lock.yaml) for body-parser versions below 1.20.9 or in the 2.0.0–2.3.x range.
  • Correlate web access logs showing compressed request bodies with container or process restart events over the same timeframe.

Monitoring Recommendations

  • Alert on elevated process restart rates for Node.js workloads and on uncaughtException events in application telemetry.
  • Monitor Web Application Firewall (WAF) and reverse proxy logs for anomalous volumes of requests carrying Content-Encoding headers.
  • Track dependency drift so that upstream security advisories from the OpenJS Foundation Security Advisories trigger patch workflows.

How to Mitigate CVE-2026-111181

Immediate Actions Required

  • Upgrade body-parser to 1.20.9 or 2.4.0 or later across all Node.js and Express services.
  • Update transitive dependencies by refreshing lock files and rebuilding container images that bundle body-parser.
  • If immediate patching is not possible, disable request-body inflation by setting the inflate option to false so encoded requests are rejected before any decompression stream is created.

Patch Information

The maintainers resolved the issue in body-parser2.4.0 and 1.20.9 by attaching proper error handling to the decompression stream. Upgrade guidance is published in the GitHub Security Advisory GHSA-27r3-jxmh-p828.

Workarounds

  • Configure body-parser with inflate: false to reject compressed requests at the middleware boundary.
  • Strip or reject Content-Encoding request headers at the reverse proxy, WAF, or API gateway for endpoints that do not require compressed uploads.
  • Rate-limit requests carrying compressed bodies from untrusted sources to reduce blast radius while patches are deployed.
bash
# Upgrade body-parser to a fixed release
npm install body-parser@^1.20.9   # for 1.x consumers
npm install body-parser@^2.4.0    # for 2.x consumers

# Temporary mitigation: disable inflation in Express
# app.js
#   const bodyParser = require('body-parser');
#   app.use(bodyParser.json({ inflate: false }));
#   app.use(bodyParser.urlencoded({ extended: true, inflate: false }));

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.