subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def _win_store(key): import subprocess subprocess.run(["cmdkey", "/delete:" + SERVICE_NAME], capture_output=True) result = subprocess.run( ["cmdkey", "/generic:" + SERVICE_NAME, "/user:" + ACCOUNT_NAME, "/pass:" + key], capture_output=True, text=True, )- Confidence
- 90% confidence
- Finding
- The API key is passed to `cmdkey` as a command-line argument (`/pass:<key>`). On Windows, command-line arguments may be exposed to local users, process inspection tools, logs, crash reports, or EDR telemetry, which can leak the secret during storage even if it is later kept in the credential manager.
