fix:ReDoS fix about pull/5971 and issues/6031 #6032
+51
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#5971
#6031
Sorry for the impact on you, this was caused by an extra space,We modified it and made it more consistent with the original regex
Regex Change to
https://github.com/mmmsssttt404/pm2/blob/1e0e96c5257041bc19b1fd796ea455c4085bec6e/lib/tools/Config.js#L203-L205

I'm deeply sorry for the errors I introduced in the code changes. My original intention was to fix Redos, but it caused a bug. In the future, I will be more cautious and fully verify before making any changes.