---
id: CVE-2018-7158
title: >-
  The `'path'` module in the Node.js 4.x release line contains a potential
  regular expression denial of service (ReDoS) vector
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 N…
severity: high
cvss: 7.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H'
cwe:
  - CWE-185
  - CWE-400
vendor: nodejs
product: node.js
affected:
  - 'node.js >= 4.0.0, <= 4.1.2'
  - 'node.js >= 4.2.0, <= 4.9.1'
published: '2018-05-17'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T22:16:47.333'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7158'
references:
  - url: 'https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/'
    label: cve-request@iojs.org
  - url: 'https://nodejs.org/en/blog/vulnerability/march-2018-security-releases/'
    label: af854a3a-2127-422b-91ae-364da2661108
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2018/cve-2018-7158.json
  - url: 'https://access.redhat.com/security/cve/CVE-2018-7158'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=1561980'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2018-7158'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2018-7158'
tags:
  - nvd
  - csaf
  - vex
  - red-hat
epss: 0.03409
epssPercentile: 0.88542
ingestedAt: '2026-10-08T23:16:47.289Z'
scores:
  nvd: 7.5
  vendor: 5.9
---

## Overview

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.

## Affected

- `node.js >= 4.0.0, <= 4.1.2`
- `node.js >= 4.2.0, <= 4.9.1`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **Red Hat VEX** · Moderate · affected: Red Hat Software Collections · no fix planned: Red Hat Software Collections · updated 2026-10-09 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2018/cve-2018-7158.json)
