One compressed request can crash a Node.js app that uses body-parser with default options
On October 22, 2026, CVE-2026-111181 was published for body-parser before 1.20.9 and from 2.0.0 before 2.4.0. With default options, a request that carries a Content-Encoding such as gzip and has trailing bytes after one valid compressed frame triggers an uncaught exception that ends the Node.js process. Body parsing runs before routing, so any endpoint that parses a body can be hit without authentication. The record scores it CVSS 3.1 7.5 High, and the fixes are body-parser 1.20.9 and 2.4.0.
What was reported
CVE-2026-111181 was published October 22, 2026 by the OpenJS Foundation. It says that in body-parser before 1.20.9, and 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 normally and the application responds, but the trailing bytes then reach the finished decoder. The decoder emits an error that is re-thrown as an uncaught exception, and the process exits. No matching route is needed, because body parsing runs before routing. The record names CWE-248, and NVD lists a CVSS 3.1 score of 7.5 High.
The project's advisory, GHSA-27r3-jxmh-p828, says no authentication is required and that the fix is in body-parser 2.4.0 and 1.20.9. Its workaround, for apps that do not need to accept compressed request bodies, is to pass inflate: false to the body-parser middleware, so encoded requests are rejected before any decompression stream is created.
Express's own JSON and URL-encoded parsers use body-parser. According to the npm registry, Express 4.21 and earlier pin an exact body-parser release below 1.20.9, so those apps need an Express upgrade before they can get the fix. Express 4.22 and later on the 4.x line, and Express 5, accept the fixed body-parser versions, so updating the lockfile is enough.
How to prevent it
Run npm ls body-parser and make sure every copy is 1.20.9, 2.4.0, or later. Express 4.21 and earlier pin an exact older body-parser, so upgrade Express to 4.22 or 5.x first. On those versions, npm update body-parser pulls in the fix. If your app never needs compressed request bodies, passing inflate: false to the body parser also blocks this.
Sources
Related
Incidents on the same topics
- A crafted URL could run PowerShell on Windows through the open package, and MCP Inspector and OpenCode were affected
- Google's Cloud Run MCP server could send your source code to a storage bucket an attacker set up first
- Better Auth accepted an OAuth sign-in state as a Magic Link token, so knowing a user's email was enough to sign in as them
- @sentry/nextjs tunnelRoute skipped Next.js middleware for more paths than it forwards to Sentry
Guides for the same stack
The weekly fix
The weekly fix: 3 real security mistakes in vibe-coded apps and how to fix them, every Tuesday.