CVE-2026-87776: compression vulnerable to Denial of Service via memory leak on premature response close
Impact
A vulnerability in compression < 1.8.2 allows an attacker to trigger a Denial of Service (DoS) by disconnecting while a compressed response is being sent. When the client aborts the connection before the response finishes, the zlib stream created to compress that response is never destroyed, so each aborted compressed response leaks its native zlib memory. Repeated aborted requests can exhaust available memory. All applications using compression are affected.
Patches
Users should upgrade to 1.8.2.
Workarounds
None.
Other sources
compression is a Node.js and Express compression middleware. In versions before 1.8.2, when a client aborts the connection while a compressed response is still being sent, the zlib stream created to compress that response is never destroyed, so each aborted compressed response leaks its native zlib memory. A remote unauthenticated attacker can repeatedly open requests and disconnect early, exhausting the available memory and crashing the server. All applications using compression are affected. The issue is fixed in compression 1.8.2, and users should upgrade to 1.8.2 or later.
— MITRE
compression vulnerable to Denial of Service via memory leak on premature response close
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/compressionto a version that resolves this vulnerability.Fixed in 1.8.2 - Upgrade
Upgrade
compressionto a version that resolves this vulnerability.Fixed in 1.8.2
Event History
Frequently Asked Questions
Who can exploit this issue?
A remote, unauthenticated attacker can exploit it by making requests that receive compressed responses and aborting the connection before those responses finish sending. Repeating this can exhaust server memory and crash the process.
Are applications affected without special configuration?
Yes. The advisory states that all applications using the compression middleware are affected; no special configuration or attacker privileges are required.
What should teams do if they cannot patch immediately?
The provided information identifies upgrading to compression 1.8.2 or later as the remediation. It does not provide a documented configuration workaround or mitigation for unpatched deployments.
How can I determine whether my application is vulnerable?
Check whether the application uses the npm compression middleware and whether its installed version is earlier than 1.8.2. Applications using compression before 1.8.2 are affected.