Repository navigation
fix(proxyauth): skip proxy authentication for transparently intercepted modes - #8637
Open
ToniAdreal wants to merge 1 commit into
Open
ToniAdreal wants to merge 1 commit into
ToniAdreal wants to merge 1 commit into
Conversation
…ed modes With proxyauth enabled, requests in transparent, local and WireGuard modes were run through the server-style auth branch: missing credentials got a 401, and a valid origin Authorization header was deleted when it happened to match the proxy credentials. Clients in these modes never present proxy credentials, so authentication is now skipped there and the flow passes through untouched. Regular, upstream, reverse and SOCKS5 modes are unchanged. Fixes mitmproxy#8631. Signed-off-by: ToniAdreal <[email protected]>
ToniAdreal
force-pushed
the
fix-8631-proxyauth-intercept-modes
branch
from
November 23, 2026 14:34
8b8ae68 to
eeb09ee
Compare
This branch has not been deployed
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.
Fixes #8631.
With
proxyauthset, requests in transparent, local and WireGuard modes went through the server-style auth branch: no credentials meant a 401, and an originAuthorizationheader that happened to match the proxy credentials got deleted on the way through. Clients in these modes never present proxy credentials, they are not talking to mitmproxy as a proxy, so there is nothing to authenticate.This skips proxy authentication in
requestheadersandhttp_connectfor transparent, local and WireGuard modes, leaving the flow (and the originAuthorizationheader) untouched. Regular, upstream, reverse and SOCKS5 modes are unchanged, and the existing reverse-mode tests still pass.I kept the scope to the three modes named in the issue. Tun mode has the same shape (traffic captured, not addressed to the proxy), happy to extend this to it as well if you would rather cover it here.
Verification: added 6 tests (no-credentials and origin-header cases for each of the three modes, for both
requestheadersandhttp_connect). They fail on main with 401s and pass with this change. Fulltest_proxyauth.pypasses (30 passed),ruff checkandruff format --checkare clean.