Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2018-7158

The `'path'` module in the Node.js 4.x release line contains a potential regular expression denial of service (ReDoS) vector. The code in question was replaced in Node.js 6.x and later so this vulnerability only impacts all versions of Node.js 4.x. The regular expression, `splitPathRe`, used within the `'path'` module for the various path parsing functions, including `path.dirname()`, `path.extname()` and `path.parse()` was structured in such a way as to allow an attacker to craft a string, that when passed through one of these functions, could take a significant amount of time to evaluate, potentially leading to a full denial of service.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2018-7158
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 07:54 UTC · Revision 1

Source evidence

CVE-2018-7158

core-osv · Original source

Published 17 May 2018, 14:29 UTC

The `'path'` module in the Node.js 4.x release line contains a potential regular expression denial of service (ReDoS) vector. The code in question was replaced in Node.js 6.x and later so this vulnerability only impacts all versions of Node.js 4.x. The regular expression, `splitPathRe`, used within the `'path'` module for the various path parsing functions, including `path.dirname()`, `path.extname()` and `path.parse()` was structured in such a way as to allow an attacker to craft a string, that when passed through one of these functions, could take a significant amount of time to evaluate, potentially leading to a full denial of service.

osv:CVE-2018-7158
Complete source record
{
  "id": "d87aee14de785a0d152d6146233301abeec567c3366321dcd21deb8e413f5910",
  "url": "https://osv.dev/vulnerability/CVE-2018-7158",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2018-7158",
    "summary": "The `'path'` module in the Node.js 4.x release line contains a potential regular expression denial of service (ReDoS) vector. The code in question was replaced in Node.js 6.x and later so this vulnerability only impacts all versions of Node.js 4.x. The regular expression, `splitPathRe`, used within the `'path'` module for the various path parsing functions, including `path.dirname()`, `path.extname()` and `path.parse()` was structured in such a way as to allow an attacker to craft a string, that when passed through one of these functions, could take a significant amount of time to evaluate, potentially leading to a full denial of service.",
    "evidence": "osv:CVE-2018-7158",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2018-7158",
      "aliases": [
        "CVE-2018-7158"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nodejs/node",
              "type": "GIT",
              "events": [
                {
                  "introduced": "f9f837885343a2a3f5ba2b8c510eaac395c8c865"
                },
                {
                  "last_affected": "85df6ada477715020dbd22e2fb5e687d84d663ff"
                },
                {
                  "introduced": "6dc12b1042d5d4727f77e8a1c5758dab91400069"
                },
                {
                  "last_affected": "b8eef6d10bf45a4d659a84d670dbf3afff0250a2"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:nodejs:node.js:*:*:*:*:-:*:*:*",
                    "range": [
                      {
                        "introduced": "4.0.0"
                      },
                      {
                        "last_affected": "4.1.2"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:nodejs:node.js:*:*:*:*:lts:*:*:*",
                    "range": [
                      {
                        "introduced": "4.2.0"
                      },
                      {
                        "last_affected": "4.9.1"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v4.9.1",
            "v4.9.0",
            "v4.8.7",
            "v4.8.6",
            "v4.8.5",
            "v4.8.4",
            "v4.8.3",
            "v4.8.2",
            "v4.8.1",
            "v4.8.0",
            "v4.7.3",
            "v4.7.2",
            "v4.7.1",
            "v4.7.0",
            "v4.6.2",
            "v4.6.1",
            "v4.6.0",
            "v4.5.0",
            "v4.4.7",
            "v4.4.6",
            "v4.4.5",
            "v4.4.4",
            "v4.4.3",
            "v4.4.2",
            "v4.4.1",
            "v4.4.0",
            "v4.3.2",
            "v4.3.1",
            "v4.3.0",
            "v4.2.6",
            "v4.2.5",
            "v4.2.4",
            "v4.2.3",
            "v4.2.2",
            "v4.2.1",
            "v4.2.0",
            "v4.1.2",
            "v4.1.1",
            "v4.1.0",
            "v4.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-7158.json"
          }
        }
      ],
      "modified": "2026-10-24T10:31:00.210947422Z",
      "provider": "osv",
      "references": [
        "https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2018-7158",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 439489,
  "published_at": "2018-05-17T14:29:00.527+00:00"
}