Skip to content

GHSA-27r3-jxmh-p828 CVE-2026-111181

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

High npm
Severity
7.5 / 10
High · CVSS 3.1
Exploit chance (EPSS)
0.39%
Chance of exploitation in the next 30 days. Higher than 32.92% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-248 Uncaught Exception
Fix
2.4.0
Upgrade body-parser to this version or later

Description

Impact

A single request can crash any application using body-parser with default options. When a request carries a Content-Encoding (for example gzip), body-parser pipes it into a decompression stream and, after reading the body, leaves that stream piped 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 authentication or matching route is required, since parsing runs before routing.

Patches

Fixed in body-parser 2.4.0 and 1.20.9. Upgrade to one of these versions.

Workarounds

Pass inflate: false to the body-parser middleware if the application does not need to accept compressed request bodies. This rejects encoded requests before any decompression stream is created.

Affected versions

npm

PackageVulnerableFixed in
body-parser
>= 2.0.0, < 2.4.0
2.4.0
body-parser
< 1.20.9
1.20.9
body-parser
>= 2.0.0, < 2.4.0
2.4.0
body-parser
< 1.20.9
1.20.9

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

body-parser npm → 2.4.0

npm
npm install body-parser@2.4.0
yarn
yarn add body-parser@2.4.0
pnpm
pnpm add body-parser@2.4.0

Severity breakdown

CVSS 3.1 7.5

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Weakness

CWE-248: Uncaught Exception

An exception is thrown from a function, but it is not caught.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-v422-hmwv-36x6
body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement
Medium Also affects body-parser
GHSA-wqch-xfxh-vrr4
body-parser is vulnerable to denial of service when url encoding is used
Medium Also affects body-parser
GHSA-qwcr-r2fm-qrc7
body-parser vulnerable to denial of service when url encoding is enabled
High Also affects body-parser
GHSA-8hrf-8g6f-7xwp
Forge: Denial of service in TLS record processing via a record interleaved with a fragmented handshake message
High Same weakness, CWE-248
GHSA-9pvw-hwfg-92h5
Wasmtime: Panic lowering a host-created component model stream into a guest that expects a different payload type
Medium Same weakness, CWE-248
GHSA-55wc-3pg8-jfw6
undici vulnerable to Denial of Service via unhandled exception in the decompress interceptor
High Same weakness, CWE-248
GHSA-qrxm-fqhp-jwvm
undici vulnerable to Denial of Service via TLS 1.2 certificate-changing renegotiation
High Same weakness, CWE-248
GHSA-xjj6-f33q-929c
undici vulnerable to Denial of Service via unhandled error on excessive content-encodings
High Same weakness, CWE-248

Credits: Phillip9587, UlisesGascon, bjohansebas, blue2cat

Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor