Bug 1561980 (CVE-2018-7158) - CVE-2018-7158 nodejs: path module regular expression denial of service
Summary: CVE-2018-7158 nodejs: path module regular expression denial of service
Alias: CVE-2018-7158
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1562026 1562027 1562028 1562034 1565268 1565604
Blocks: 1561984
TreeView+ depends on / blocked
Reported: 2018-03-29 09:50 UTC by Adam Mariš
Modified: 2020-11-05 10:32 UTC (History)
21 users (show)

Fixed In Version: nodejs 4.9.0, nodejs 6.0
Doc Type: If docs needed, set a value
Doc Text:
It was found that the 'path' module from Node.js was vulnerable to a Regular Expression Denial of Service (REDoS) flaw. An attacker able to provide a specially crafted file path to a Node.js script could force it to hang indefinitely.
Clone Of:
Last Closed: 2018-07-17 12:38:46 UTC

Attachments (Terms of Use)

Description Adam Mariš 2018-03-29 09:50:42 UTC
A regular expression used for parsing POSIX paths could be used to cause a denial of service if an attacker were able to have a specially crafted path string passed through one of the impacted 'path' module functions.



Comment 1 Adam Mariš 2018-03-29 12:07:02 UTC
Created nodejs tracking bugs for this issue:

Affects: fedora-all [bug 1562027]
Affects: epel-all [bug 1562026]

Comment 5 Cedric Buissart 2018-04-06 14:30:19 UTC
Upstream commits for nodejs-4 implementation :

Comment 9 Cedric Buissart 2018-04-10 12:12:40 UTC
Contrary to what upstream changelog suggests, it appears that this CVE affects only nodejs-4.x. Node.js 6 and above had the 'path' library rewritten to avoid inefficient regular expressions. 
In Node.js 4, the fix was to backport the newer path parsing method from Node.js 8.

Comment 10 Jason Shepherd 2018-06-13 21:15:36 UTC
NodeJS is only provided in Openshift Enterprise 3.9 via Red Hat Software Collections. Changing Openshift Enterprise to not affected.

Note You need to log in before you can comment on or make changes to this bug.