Vulnerabilities in pkg:npm/pm2

PACKAGE
Advisory Identifier: GHSA-x5gf-qvw8-r2rm
Advisory Summary

CVE-2025-5891 is a LOW (CVSS 4.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Pm2 libraries in the npm ecosystem. The issue involves pm2 regular expression denial of service vulnerability. Remediation is available by upgrading affected packages to version 7.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/pm2

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-x5gf-qvw8-r2rm CVE-2025-5891 LOW pm2 Regular Expression Denial of Service vulnerability

CVE-2025-5891 at a Glance

CVE Identifier CVE-2025-5891
GHSA Identifier GHSA-x5gf-qvw8-r2rm
Severity LOW
CVSS v3.1 Base Score 4.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Pm2
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2025-5891

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

pm2 fixed: 7.0.0
npm install pm2@7.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 pm2

How to Check if You Are Affected

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

npm ls pm2

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

Note: The npm ls pm2 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 Pm2, 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

A vulnerability classified as problematic was found in Unitech pm2 prior to 7.0.0. This vulnerability affects unknown code of the file /lib/tools/Config.js. The manipulation leads to inefficient regular expression complexity. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.

CVE-2025-5891 Affected Pm2 Versions

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

References

Frequently Asked Questions

What is CVE-2025-5891?
CVE-2025-5891 is a security vulnerability in Pm2 involving pm2 Regular Expression Denial of Service vulnerability under CWE-400: Uncontrolled Resource Consumption.
Which Pm2 versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: pm2.
What version fixes CVE-2025-5891?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pm2 affected?
Yes, pm2 is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What is the CVSS score of CVE-2025-5891?
CVE-2025-5891 has a CVSS v3.1 base score of 4.3 (LOW) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2025-5891?
CVE-2025-5891 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 CVE-2025-5891?
Run the dependency tree command: 'npm ls pm2'. 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-x5gf-qvw8-r2rm",
  "modified" : "2026-05-20T02:06:26Z",
  "published" : "2025-06-09T21:30:51Z",
  "aliases" : [ "CVE-2025-5891" ],
  "summary" : "pm2 Regular Expression Denial of Service vulnerability",
  "details" : "A vulnerability classified as problematic was found in Unitech pm2 prior to 7.0.0. This vulnerability affects unknown code of the file /lib/tools/Config.js. The manipulation leads to inefficient regular expression complexity. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "pm2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-5891"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Unitech/pm2/issues/6075"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Unitech/pm2/pull/5971"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Unitech/pm2/commit/8b9354800a1d157cb9503a3ec414ef1e4700dc1c"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/mmmsssttt404/407e2ffe3e0eaa393ad923a86316a385"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Unitech/pm2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Unitech/pm2/blob/ba62cae9b9b7116ee758b70f538919a52515fa26/CHANGELOG.md?plain=1#L36"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Unitech/pm2/releases/tag/v7.0.0"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.311662"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.311662"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?submit.585750"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333", "CWE-400" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-10T22:52:17Z",
    "nvd_published_at" : "2025-06-09T19:15:25Z"
  }
}