The vulnerability exists in the pbts command-line tool of protobuf.js. Specifically, the main function in cli/pbts.js was using child_process.exec to call jsdoc. The command passed to exec was constructed by concatenating strings, including file paths provided as input to pbts. An attacker could provide a specially crafted file path containing shell metacharacters, which would then be executed by the shell, leading to OS command injection. The patch replaces the insecure child_process.exec call with child_process.spawn, which takes arguments as an array, thus preventing the shell from interpreting any special characters in the file paths. The vulnerable function is main in cli/pbts.js, as it is the function that contains the vulnerable child_process.exec call.