py-winrm-plugin icon indicating copy to clipboard operation
py-winrm-plugin copied to clipboard

Proxy password written in clear text to the execution log at debug level

Open skywalkw3r opened this issue 1 month ago • 0 comments

The Proxy option is documented as accepting credentials (http://user:pass@server:port, socks5://user:pass@server:port). When a job runs with debug log level, winrm-exec.py logs the raw proxy value:

log.debug("winrmproxy: " + str(winrmproxy))

(added in 9b0f72f). This bypasses common._redact_proxy_url(), which configure_proxy() already uses for its info-level messages, so the proxy password ends up in the Rundeck execution log, readable by anyone who can view that execution.

Steps to reproduce

  1. Set the node executor's Proxy option to http://user:secret@proxy:3128.
  2. Run any command on a WinRM node with the job/command log level set to Debug.
  3. Look at the execution log output.

Actual

winrmproxy: http://user:secret@proxy:3128

Expected

The credentials are redacted, consistent with the info-level "Connecting to ... via PROXY (...)" line:

winrmproxy: http://proxy:3128

winrm-filecopier.py and winrm-check.py do not have an equivalent raw-proxy log line; they only go through configure_proxy().

I reproduced this on a local Rundeck 6.4.0-SNAPSHOT server against a stub WinRM endpoint, with the proxy set as the winrm-proxy node attribute.

skywalkw3r avatar Oct 18 '26 20:10 skywalkw3r