Skip to content

Commit

Permalink
fix: limit atom length to avoid exponential backtracking
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Nov 22, 2023
1 parent 1183ee8 commit 7bb23e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/helpers/regexes/mix.regexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
* RegEx to parse the project name from mix.exs content
*/
const mixProjectNameRegex = RegExp(
/(?<=\bdef project\b)(?:(?!\bend\b).)+?app:\s*:([A-Za-z0-9_@]+)+?.+?(?=end)/,
/(?<=\bdef project\b)(?:(?!\bend\b).)+?app:\s*:([A-Za-z0-9_@]{1,255})+?.+?(?=end)/,

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of '0'.
"s",
);

Expand Down

0 comments on commit 7bb23e9

Please sign in to comment.