GHSA-4xcv-9jjx-gfj3: Mem Denial of Service Vulnerability

MODERATE
CVSS 5.1
CWE-400
Published
Advisory Summary

GHSA-4xcv-9jjx-gfj3 is a MODERATE (CVSS 5.1) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Mem libraries in the npm ecosystem. The issue involves denial of service in mem. Remediation is available by upgrading affected packages to version 4.0.0.

GHSA-4xcv-9jjx-gfj3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-4xcv-9jjx-gfj3
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Mem
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.1

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

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

How to Fix GHSA-4xcv-9jjx-gfj3

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

mem fixed: 4.0.0
npm install mem@4.0.0
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 mem

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-4xcv-9jjx-gfj3, inspect your project dependencies using npm:

npm ls mem

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

Note: The npm ls mem 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Mem, 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

Versions of `mem` prior to 4.0.0 are vulnerable to Denial of Service (DoS). The package fails to remove old values from the cache even after a value passes its `maxAge` property. This may allow attackers to exhaust the system's memory if they are able to abuse the application logging. ## Recommendation Upgrade to version 4.0.0 or later.

GHSA-4xcv-9jjx-gfj3 Affected Mem Versions

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

References

Frequently Asked Questions

What is GHSA-4xcv-9jjx-gfj3?
GHSA-4xcv-9jjx-gfj3 is a security vulnerability in Mem involving Denial of Service in mem under CWE-400: Uncontrolled Resource Consumption.
Which Mem versions are affected?
Affected versions include releases prior to 4.0.0 across affected packages: mem.
What version fixes GHSA-4xcv-9jjx-gfj3?
Upgrading to 4.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mem affected?
Yes, mem is affected in releases prior to 4.0.0. Upgrade your dependency to 4.0.0 or later.
What is the CVSS score of GHSA-4xcv-9jjx-gfj3?
GHSA-4xcv-9jjx-gfj3 has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-4xcv-9jjx-gfj3?
GHSA-4xcv-9jjx-gfj3 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for GHSA-4xcv-9jjx-gfj3?
Run the dependency tree command: 'npm ls mem'. 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-4xcv-9jjx-gfj3",
  "modified" : "2021-08-17T15:44:45Z",
  "published" : "2019-07-05T21:07:58Z",
  "aliases" : [ ],
  "summary" : "Denial of Service in mem",
  "details" : "Versions of `mem` prior to 4.0.0 are vulnerable to Denial of Service (DoS).  The package fails to remove old values from the cache even after a value passes its `maxAge` property. This may allow attackers to exhaust the system's memory if they are able to abuse the application logging.\n\n\n## Recommendation\n\nUpgrade to version 4.0.0 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mem"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sindresorhus/mem/commit/da4e4398cb27b602de3bd55f746efa9b4a31702b"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1623744"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:mem:20180117"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1084"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-07-03T20:52:42Z",
    "nvd_published_at" : null
  }
}