pm2
pm2 copied to clipboard
fix:ReDoS fix about pull/5971 and issues/6031
| Q | A |
|---|---|
| Bug fix? | yes |
| New feature? | no |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #1234, #5678 |
| License | MIT |
| Doc PR | https://github.com/Unitech/pm2/pull/5971 |
https://github.com/Unitech/pm2/pull/5971 https://github.com/Unitech/pm2/issues/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
(?<![\w\-])([\w\-]+\="[^"]*")|(?<![\w\-])([\w\-]+\='[^']*')|"([^"]*)"|'([^']*)'|\s
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.