body-parser versions <2.4.0 and <1.20.9 vulnerable to denial-of-service via trailing bytes in compressed requests
A single crafted compressed request can crash any Express app using body-parser default options, affecting versions ≥2.0.0 < 2.4.0 and < 1.20.9.
The OpenJS Security Advisories published a new advisory (CVE‑2026‑111181) on 22 Oct 2026 reporting that body-parser ≥ 2.0.0 < 2.4.0 and < 1.20.9 can be forced to crash an application with a single crafted request. When a request includes a Content‑Encoding such as gzip, body-parser streams the payload to a decompressor. If the compressed frame is followed by trailing bytes, the decoder finishes, then receives the extra bytes, emits an error without a listener, and the error bubbles up as an uncaught exception, terminating the Node process. No authentication or route matching is required because parsing occurs before routing.
The issue is fixed in body-parser 2.4.0 and 1.20.9. Upgrading to either version eliminates the crash. As a temporary mitigation, applications can pass inflate: false to the middleware to reject compressed bodies entirely, at the cost of losing support for gzip/deflate payloads.
Our take. Engineers should upgrade body-parser to 2.4.0 or 1.20.9 immediately, or disable compression handling, to prevent unexpected process termination in production services.
- OpenJS Security AdvisoriesPublished