Vulnerabilities in pkg:npm/compression

PACKAGE
Advisory Identifier: GHSA-vc2v-76pw-4v95
Advisory Summary

CVE-2026-87776 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-459: Incomplete Cleanup) affecting Compression libraries in the npm ecosystem. The issue involves compression vulnerable to denial of service via memory leak on premature response close. Remediation is available by upgrading affected packages to version 1.8.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/compression

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/compression. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vc2v-76pw-4v95 CVE-2026-87776 HIGH compression vulnerable to Denial of Service via memory leak on premature response close

CVE-2026-87776 at a Glance

CVE Identifier CVE-2026-87776
GHSA Identifier GHSA-vc2v-76pw-4v95
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-459: Incomplete Cleanup
Affected Product Compression
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-87776

To remediate this vulnerability, upgrade all affected Compression dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

compression fixed: 1.8.2
npm install compression@1.8.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls compression

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-87776, inspect your project dependencies using npm:

npm ls compression

Analyze the terminal output to locate any version of Compression in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.2), your application is affected.

Note: The npm ls compression command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-459: Incomplete Cleanup, where the product does not properly "clean up" and remove temporary or supporting resources after they have been used. In Compression, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-87776 Affected Compression Versions

1 component(s)
Fixed Versions:
1.8.2
Product / Package Ecosystem Affected Versions Fixed Version
compression
npm
< 1.8.2
1.8.2

References

Frequently Asked Questions

What is CVE-2026-87776?
CVE-2026-87776 is a security vulnerability in Compression involving compression vulnerable to Denial of Service via memory leak on premature response close under CWE-459: Incomplete Cleanup.
Which Compression versions are affected?
Affected versions include releases prior to 1.8.2 across affected packages: compression.
What version fixes CVE-2026-87776?
Upgrading to 1.8.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is compression affected?
Yes, compression is affected in releases prior to 1.8.2. Upgrade your dependency to 1.8.2 or later.
What is the CVSS score of CVE-2026-87776?
CVE-2026-87776 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-87776?
CVE-2026-87776 is classified under CWE-459: Incomplete Cleanup (The product does not properly "clean up" and remove temporary or supporting resources after they have been used.).
How can I check npm dependencies for CVE-2026-87776?
Run the dependency tree command: 'npm ls compression'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vc2v-76pw-4v95",
  "modified" : "2026-10-05T23:28:01Z",
  "published" : "2026-10-05T23:28:01Z",
  "aliases" : [ "CVE-2026-87776" ],
  "summary" : "compression vulnerable to Denial of Service via memory leak on premature response close",
  "details" : "### Impact\n\nA 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.\n\n### Patches\n\nUsers should upgrade to `1.8.2`.\n\n### Workarounds\n\nNone.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "compression"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/compression/security/advisories/GHSA-vc2v-76pw-4v95"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-87776"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/compression/commit/151f63e91e1b64f8fb0b064e19321a4f28db6bff"
  }, {
    "type" : "WEB",
    "url" : "https://cna.openjsf.org/security-advisories.html"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/expressjs/compression"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/expressjs/compression/releases/tag/v1.8.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-401", "CWE-459" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T23:28:01Z",
    "nvd_published_at" : "2026-09-11T12:16:52Z"
  }
}