Regular Expression Denial of Service (ReDoS)
Description
This affects the package glob-parent before 5.1.2. The enclosure regex used to check for strings ending in enclosure containing path separator.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
glob-parent before 5.1.2 contains a regular expression denial of service (ReDoS) vulnerability via a crafted enclosure string.
Vulnerability
The glob-parent package before version 5.1.2 uses a regular expression to check for strings ending in an enclosure containing a path separator. The regex is vulnerable to catastrophic backtracking, leading to ReDoS [1][2].
Exploitation
An attacker can provide a specially crafted string that causes the regex engine to take exponential time to evaluate. No authentication or special privileges are required; the attacker only needs to supply the malicious input to any application using the vulnerable glob-parent version [2].
Impact
Successful exploitation results in a denial of service (DoS) condition, where the application becomes unresponsive or crashes due to excessive CPU consumption [2][3][4].
Mitigation
Upgrade to glob-parent version 5.1.2 or later, which contains a fix for the vulnerable regex [1][2]. No workarounds are available; updating the package is the recommended mitigation.
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
glob-parentnpm | >= 4.0.0, < 5.1.2 | 5.1.2 |
Affected products
11- glob-parent/glob-parentdescription
- osv-coords10 versionspkg:bitnami/gulppkg:npm/glob-parentpkg:rpm/almalinux/nodejspkg:rpm/almalinux/nodejs-develpkg:rpm/almalinux/nodejs-docspkg:rpm/almalinux/nodejs-full-i18npkg:rpm/almalinux/nodejs-libspkg:rpm/almalinux/nodejs-nodemonpkg:rpm/almalinux/nodejs-packagingpkg:rpm/almalinux/npm
< 5.1.2+ 9 more
- (no CPE)range: < 5.1.2
- (no CPE)range: >= 4.0.0, < 5.1.2
- (no CPE)range: < 1:16.13.1-3.module_el8.5.0+2605+45d748af
- (no CPE)range: < 1:16.13.1-3.module_el8.5.0+2605+45d748af
- (no CPE)range: < 1:16.13.1-3.module_el8.5.0+2605+45d748af
- (no CPE)range: < 1:16.13.1-3.module_el8.5.0+2605+45d748af
- (no CPE)range: < 1:16.16.0-1.el9_0
- (no CPE)range: < 2.0.15-1.module_el8.6.0+2904+f21ad6f4
- (no CPE)range: < 25-1.module_el8.5.0+246+05401605
- (no CPE)range: < 1:8.1.2-1.16.13.1.3.module_el8.5.0+2605+45d748af
Patches
14a80667c6935feat: hoist regexps and strings for performance gains
1 file changed · +13 −7
index.js+13 −7 modified@@ -1,18 +1,24 @@ 'use strict'; -var isglob = require('is-glob'); +var isGlob = require('is-glob'); var pathDirname = require('path-dirname'); var isWin32 = require('os').platform() === 'win32'; +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\/]*.*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\*\?\|\[\]\(\)\{\}])/g; + module.exports = function globParent(str) { // flip windows path separators - if (isWin32 && str.indexOf('/') < 0) { - str = str.split('\\').join('/'); + if (isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); } // special case for strings ending in enclosure containing path separator - if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) { - str += '/'; + if (enclosure.test(str)) { + str += slash; } // preserves full path in case of trailing path separator @@ -21,8 +27,8 @@ module.exports = function globParent(str) { // remove path parts that are globby do { str = pathDirname.posix(str); - } while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); + } while (isGlob(str) || globby.test(str)); // remove escape chars and return result - return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); + return str.replace(escaped, '$1'); };
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
11- github.com/advisories/GHSA-ww39-953v-wcq6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-28469ghsaADVISORY
- github.com/gulpjs/glob-parent/blob/6ce8d11f2f1ed8e80a9526b1dc8cf3aa71f43474/index.js%23L9ghsax_refsource_MISCWEB
- github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457eghsaWEB
- github.com/gulpjs/glob-parent/pull/36ghsax_refsource_MISCWEB
- github.com/gulpjs/glob-parent/pull/36/commits/c6db86422a9731d4f3d332ce4a81c27ea6b0ee46ghsaWEB
- github.com/gulpjs/glob-parent/releases/tag/v5.1.2ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSBOWERGITHUBES128-1059093ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1059092ghsax_refsource_MISCWEB
- snyk.io/vuln/SNYK-JS-GLOBPARENT-1016905ghsax_refsource_MISCWEB
- www.oracle.com/security-alerts/cpujan2022.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.