The vulnerability is a Regular Expression Denial of Service (ReDoS) in Unitech/pm2 specifically within the lib/tools/Config.js file. Direct access to commit information or file content via GitHub API tools failed due to authentication issues. However, a publicly available proof-of-concept (POC) from https://gist.github.com/mmmsssttt404/407e2ffe3e0eaa393ad923a86316a385 clearly demonstrates the vulnerability. The POC imports the Config.js module (implicitly lib/tools/Config.js based on the vulnerability description) and calls the _valid function with a malicious input string (value = "" + "a".repeat(100000) + "=";). This input is designed to cause excessive backtracking in a poorly constructed regular expression within the _valid function, leading to high CPU usage and a denial of service, which is confirmed by the POC's timing mechanism. The vulnerability description corroborates that the issue lies in lib/tools/Config.js and involves inefficient regular expression complexity. Therefore, the _valid function is identified as the vulnerable function that processes the malicious input and triggers the ReDoS condition. The function signature would be _valid as it's a method of the config object, which is an instance of the module exported by Config.js.
Root Cause: The root cause is an inefficient regular expression within the _valid function in lib/tools/Config.js. This regex exhibits catastrophic backtracking when processing certain patterns, particularly long sequences of characters like the one used in the POC. This leads to excessive CPU consumption, effectively denying service to other operations or users of the pm2 process manager.