CVE-2026-137184: PowerShell MCP: WinRM credentials exposed in spawned PowerShell command line
PowerShell MCP is a Model Context Protocol server for headless Windows operations. Prior to 0.5.3, the winrmexec tool places a script containing the caller-supplied WinRM username and plaintext password in the PowerShell child process's -Command argument when explicit credentials are used. Local users or monitoring systems with access to process command lines or retained telemetry can recover the credentials. sshexec is not affected because it uses SSH in process. This issue is fixed in 0.5.3.
Other sources
The winrmexec tool constructed a PowerShell script containing the caller-supplied WinRM username and plaintext password, then passed that full script as the literal value of the PowerShell -Command process argument. Local users, privileged monitoring agents, process-creation audit logs, EDR, or SIEM tooling with access to process command lines could recover the credential while the child ran or from retained telemetry. Exploitation requires use of explicit WinRM credentials plus local process-command-line or log visibility on the MCP host. sshexec is not affected because it uses ssh2 in-process.
The issue is fixed in @imrrd/powershell-mcp 0.5.3 by keeping a fixed non-sensitive PowerShell bootstrap in argv and transporting all caller-controlled WinRM data through child stdin. The deprecated unscoped powershell-mcp package will not receive a patched legacy release; remove it and install @imrrd/powershell-mcp@0.5.3 or later.
Reported responsibly by Syed Anas Mohiuddin, Independent Researcher, Maintainer of mcp-safeguard (@SyedAnas01).
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@imrrd/powershell-mcpto a version that resolves this vulnerability.Fixed in 0.5.3 - Upgrade
Upgrade
@imrrd/powershell-mcpto a version that resolves this vulnerability.Fixed in 0.5.3 - Remove
Remove
powershell-mcpfrom your environment.Remove the deprecated unscoped powershell-mcp package; it will not receive a patched legacy release.
Event History
Frequently Asked Questions
Which deployments are affected?
PowerShell MCP versions prior to 0.5.3 are affected when the winrm_exec tool is used with explicit WinRM credentials. The issue occurs because the supplied username and plaintext password are included in a spawned PowerShell process command line.
Who could recover the exposed credentials?
Local users and monitoring systems that can access process command lines may recover them. Credentials may also be recoverable from retained telemetry that recorded those command lines.
Is the SSH execution path affected?
No. The ssh_exec tool is not affected because it uses SSH in process rather than placing credentials in a spawned PowerShell command line.
How can I assess whether credentials may already have been exposed?
Review whether winrm_exec was used with explicit credentials on an affected version, then check process-command-line monitoring and retained telemetry for the corresponding PowerShell -Command arguments. Any credentials found in those records should be treated as exposed.
What should be done if this applies to our environment?
Upgrade PowerShell MCP to version 0.5.3, which fixes the issue. For potentially exposed WinRM credentials, rotate them and limit access to command-line telemetry and process inspection data.