Skip to content

Commit

Permalink
Credit @yetingli for the regexp improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 7, 2022
1 parent 707e1b2 commit 47e0e45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions minimatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ function braceExpand (pattern, options) {

assertValidPattern(pattern)

// Thanks to Yeting Li <https://github.com/yetingli> for
// improving this regexp to avoid a ReDOS vulnerability.
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
// shortcut. no need to expand.
return [pattern]
Expand Down

0 comments on commit 47e0e45

Please sign in to comment.