Evil-WinRM
CVE-2026-55201
HIGH
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attacker controls a network-reachable WinRM server (AV:N, PR:N), victim must run download_dir (UI:R), and overwriting authorized_keys yields high integrity and downstream confidentiality impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
3DescriptionCVE.org
Evil-WinRM through 3.9, fixed in commit 6ecd570, contains a path traversal vulnerability in the download_dir() function that allows a rogue or compromised remote Windows server to write files outside the intended download directory by returning filenames with traversal sequences from Get-ChildItem command output that are passed unsanitized to File.join(). Attackers controlling the remote server can exploit this to overwrite sensitive client-side files such as SSH authorized_keys or shell configuration files, achieving persistent access or privilege escalation on the client machine.
AnalysisAI
Path traversal in Evil-WinRM through 3.9 lets a malicious or compromised remote Windows server overwrite arbitrary files on the operator's client machine when the user invokes the download_dir() function. Because Evil-WinRM is the offensive operator's tool, this inverts the trust model - the 'target' Windows host becomes the attacker and the red teamer or admin running Evil-WinRM becomes the victim, with realistic outcomes including persistent SSH access via overwritten authorized_keys. No public exploit identified at time of analysis, but a public upstream patch (commit 6ecd570) discloses the exact unsanitized File.join() sink.
Technical ContextAI
Evil-WinRM is a Ruby-based WinRM shell widely used by penetration testers and red teams to interact with Windows hosts. The download_dir() routine enumerates files on the remote host with PowerShell's Get-ChildItem, then passes each returned filename directly into Ruby's File.join(local_path, file.strip) to build the local write path. Ruby's File.join performs no normalization of '..' segments, so a server that returns crafted filenames such as '..\..\.ssh\authorized_keys' causes writes outside the operator-specified download directory. This is a textbook CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) with the twist that the untrusted input source is the remote shell endpoint rather than a typical web request, matching the CPE cpe:2.3:a:hackplayers:evil-winrm.
RemediationAI
Upstream fix available as commit 6ecd570 (PR #81 at https://github.com/Hackplayers/evil-winrm/pull/81); operators should update to a build that includes this commit - the patch sanitizes each filename via File.basename and skips empty, '.' and '..' entries before joining to the local path. Until a packaged release is consumed, operators can mitigate by avoiding the download_dir command against untrusted or potentially compromised Windows hosts (use single-file download with operator-chosen names instead), or by running Evil-WinRM inside a disposable VM or unprivileged container so that any out-of-tree write lands in a throwaway home directory rather than overwriting real ~/.ssh/authorized_keys, ~/.bashrc, or ~/.zshrc. Reviewers should consult the VulnCheck advisory at https://www.vulncheck.com/advisories/evil-winrm-path-traversal-in-download-dir-function for additional vendor guidance.
Same weakness CWE-22 – Path Traversal
View allSame technique Privilege Escalation
View allShare
External POC / Exploit Code
Leaving vuln.today