glob-parent: Regular expression denial of service

Viewed 10063

I got my build broken because yarn audit says there is a vulnerability in my dependencies:

yarn audit
yarn audit v1.22.5
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ moderate      │ Regular expression denial of service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ glob-parent                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.1.2                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ webpack-dev-server                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ webpack-dev-server > chokidar > glob-parent                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1751                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 819
Severity: 1 Moderate
Done in 0.67s.

Exited with code exit status 4
2 Answers

in your package.json add:

  "resolutions": {
    "glob-parent": "5.1.2"
  }

and you can ignore the warning:

warning Resolution field "glob-parent@5.1.2" is incompatible with requested version "glob-parent@^3.1.0"
Related