Repository navigation
Conversation
…requests WinRM clients send an absolute-form request target even on a direct connection, so winrmrelayserver/winrmsrelayserver classified every request as proxy traffic, answered 407 and the client dropped the connection. Treat WinRM requests as direct. Refs fortra#2379
ihadimh
force-pushed
the
fix/winrm-407
branch
from
November 17, 2026 11:17
4f0474a to
661382e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2379
Summary
winrmrelayserver.pyandwinrmsrelayserver.pydecide whether a client is using them as a proxy by checking whetherself.pathstarts withhttp. Windows WinRM clients send an absolute-form request target (POST http://host:5985/wsman HTTP/1.1) even on direct connections, so every relayed request was classified as a proxy request: the server looked forProxy-Authorization, found none, and answered407 Proxy Authentication Required. The client drops the connection instead of retrying, so the relay silently fails and ntlmrelayx logs nothing useful.This treats WinRM connections as direct in both WinRM relay servers. The HTTP relay server keeps the existing heuristic.
Reproduction
Start the WinRM relay server on a loopback port and send a request with an absolute-form target:
Before this change:
After this change:
Tests
New
tests/misc/test_winrm_relay_server.pystarts the relay server on a loopback port and covers both request-target forms. The absolute-form case fails on the current code withHTTP/1.1 407 Proxy Authentication Requiredand passes with this change (2 passed).Trade-off
WinRM proxy mode is no longer auto-detected. An absolute-form request target is indistinguishable from proxy traffic at this layer, and direct connections are the common case. If implicit WinRM proxy support still matters, an explicit option would be the safer way to restore it.
Patch prepared with AI assistance.