---
id: "CVE-2026-111181"
kind: "vulnerability"
aliases: ["CVE-2026-111181", "GHSA-27r3-jxmh-p828"]
title: "body-parser vulnerable to Denial of Service via trailing bytes after a compressed request body"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "body-parser", "fixed": ["2.4.0"], "affected": ">= 2.0.0, < 2.4.0", "ecosystem": "npm"}, {"name": "body-parser", "fixed": ["1.20.9"], "affected": "< 1.20.9", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["api-servers", "cwe-248", "express", "node", "npm", "package", "self-hosted"]
not_affected_if: ["body-parser-patched", "default-config-not-used", "no-request-body-parsing"]
published_at: "2026-10-22T15:17:04+00:00"
first_seen_at: "2026-10-23T20:59:05+00:00"
updated_at: "2026-10-23T21:57:31+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-27r3-jxmh-p828", "first_seen_at": "2026-10-23T20:59:05+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-111181", "first_seen_at": "2026-10-23T21:57:31+00:00"}]
---

# body-parser vulnerable to Denial of Service via trailing bytes after a compressed request body

body-parser, the Express middleware that reads request bodies, crashes the whole Node process when a request has a compressed body followed by trailing bytes. The attacker gets a denial of service with one unauthenticated HTTP request.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:body-parser affected >= 2.0.0, < 2.4.0 fixed 2.4.0
- npm:body-parser affected < 1.20.9 fixed 1.20.9

## How to check

Run npm ls body-parser in each app and check for a version >= 2.0.0 and < 2.4.0, or < 1.20.9.
If the app is on Express, check the body-parser version its express dependency resolves to.

## Fix

Upgrade body-parser to 2.4.0 (2.x line) or 1.20.9 (1.x line) and redeploy.
Workaround if upgrade is delayed: set inflate: false on the body-parser middleware, which rejects compressed request bodies.

## Timeline

- 2026-10-23T20:59:05+00:00 ghsa https://github.com/advisories/GHSA-27r3-jxmh-p828
- 2026-10-23T21:57:31+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-111181

## From the sources

body-parser is body parsing middleware for Node.js and Express. In versions before 1.20.9 and in versions from 2.0.0 before 2.4.0, a single request can crash any application using body-parser with default options. When a request carries a Content-Encoding such as gzip, body-parser pipes it into a decompression stream and, after reading the body, leaves that stream with no error listener. A payload of one valid compressed frame followed by trailing bytes decodes and the application responds normally, but the trailing bytes then reach the already-finished decoder, which emits an error that is re-thrown as an uncaught exception and terminates the process. No matching route is required because body parsing runs before routing, so any endpoint that parses a body is affected. The issue is fixed in body-parser 2.4.0 and 1.20.9, and users should upgrade to one of those versions or later. As a workaround, disable request-body inflation (set the body-parser inflate option to false) so encoded requests are rejected before any decompression stream is created.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
