PowerShell MCP leaked WinRM passwords in command lines
A flaw in the winrm_exec tool put plaintext credentials where any local user, EDR agent or audit log could read them, according to an advisory published on 30 November 2026.
By The Agentic Times ·

A security advisory published on 30 November 2026 says the PowerShell MCP server exposed Windows Remote Management usernames and plaintext passwords in the command lines of the PowerShell processes it spawned. The flaw, tracked as CVE-2026-137184 in GitHub advisory GHSA-mf4q-589h-8gwx, affects the npm packages @imrrd/powershell-mcp and the deprecated unscoped powershell-mcp. It is fixed in @imrrd/powershell-mcp version 0.5.3.
According to the advisory, the problem sat in the server's winrm_exec tool. The tool built a PowerShell script that contained the caller-supplied WinRM username and password, then handed that whole script to PowerShell as the literal value of the -Command process argument. Anything able to read process command lines on the host could therefore read the credential in clear text.
That is a wider audience than it sounds. The advisory lists local users, privileged monitoring agents, process-creation audit logs, and endpoint detection and response or SIEM tooling, the security software that collects and retains system telemetry. Credentials could be recovered while the child process was running, or later from stored logs. In other words, a routine security control designed to watch what processes run would quietly archive the passwords an agent used.
MCP, the Model Context Protocol, is the interface standard that lets AI assistants call external tools. A PowerShell MCP server gives a model the ability to run Windows commands, including against remote machines over WinRM. The exposure only matters where explicit WinRM credentials are used. The advisory states that exploitation requires both the use of those explicit credentials and local process-command-line or log visibility on the MCP host. The server's other remote tool, ssh_exec, is not affected, because it uses the ssh2 library in-process rather than spawning a child command.
The fix changes how the data travels. In version 0.5.3, the maintainer keeps a fixed, non-sensitive PowerShell bootstrap in the process arguments and sends all caller-controlled WinRM data through the child process's standard input instead. Standard input is not recorded in process command lines, so the credential no longer appears in process tables or process-creation logs.
Users of the deprecated unscoped powershell-mcp package will not get a patch. The advisory says no fixed legacy release is planned for that package and advises removing it and installing @imrrd/powershell-mcp at version 0.5.3 or later.
The issue was reported responsibly by Syed Anas Mohiuddin, an independent researcher and the maintainer of the mcp-safeguard project, according to the advisory. No exploitation has been reported in the advisory, and it does not say how long the affected versions were in circulation. Anyone who ran winrm_exec with explicit credentials on an affected version should assume those passwords may sit in retained telemetry, and treat rotation accordingly.
Sources
- github.comhttps://github.com/advisories/GHSA-mf4q-589h-8gwx
