The vulnerability exists in the updateEnvFile function located in src/auth/oauth.ts. The function is responsible for updating the .env configuration file. Prior to the patch, the function would read the .env file, and then for each key-value pair to be updated, it would use a regular expression to find and replace the line, or append a new line if the key did not exist. The new line was constructed as ${key}=\"${value}\". The value was not sanitized for newlines or other special characters. This allowed an attacker who could control the value to inject arbitrary content into the .env file, including new environment variable definitions. This could lead to configuration overwrites, denial of service, or potentially remote code execution. The patch addresses this vulnerability by replacing the manual file parsing and string manipulation with the dotenv and dotenv-stringify libraries. These libraries correctly parse and serialize the .env file, ensuring that values are properly quoted and escaped, thus preventing injection attacks.