-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/ssh: TestClientAuthMaxAuthTriesPublicKey failures with WSAECONNABORTED #50805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like the expected error comes from the server side, here: The actual error message looks like it is coming from the client side, from the connection being dropped without receiving the response from the server. |
We could mask this on the builders by adding a test skip, but note that it affects Marking as release-blocker (per #11811) pending a decision from the security team as to whether to skip the test on |
#50161 may be closely related, in that the client is observing I think the |
CC @golang/security Can you please take a look at whether this should be a test skip or if additional investigation is need? |
This error appears to mean that the client is writing to a socket that the server has already closed, and then trying to read the server's response. It seems that on Windows in this scenario the write to a socket that the server has closed can put the socket into an error condition that is reported during the read. This is the normal sequence of packets in this test:
As far as I can tell, there is nothing that prevents the client from seeing the final |
Change https://golang.org/cl/381614 mentions this issue: |
If I understand correctly, the race you're describing is between the client responding to the final |
The server code does not consider whether it has reached the maximum number of permitted authentication requests when it assembles its list of permitted authentication methods. I could certainly change the server code so that it returns no permitted methods when it has exceeded the number of authentication failures. All the tests pass when I do so. I sent that CL too. @rolandshoemaker can choose (or do something else entirely). Thanks. |
Change https://golang.org/cl/381615 mentions this issue: |
I'm not sure it's particularly necessary to send the SSH_MSG_USERAUTH_FAILURE packet if we are going to immediately send the SSH_MSG_DISCONNECT packet, although the spec is somewhat confusing on this (my reading is that it suggests it is necessary to always send the failure message regardless of what you're going to do next). OpenSSH seems to just immediately send the SSH_MSG_DISCONNECT packet and terminate, which is generally the source of truth for SSH. I'm not really strongly opinionated on this, I think I err of the side of just matching OpenSSH behavior if we are going to change anything here (rather than just sending an empty methods list). In that case I think we'd just want to add a |
(Also +2'd CL381614, but I think equally just immediately sending the disconnect packet would also solve this race.) |
Fixes golang/go#50805 Change-Id: Icdd2835b1626240faf61936288f279570c873158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
Fixes golang/go#50805 Change-Id: Icdd2835b1626240faf61936288f279570c873158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
Fixes golang/go#50805 Change-Id: Icdd2835b1626240faf61936288f279570c873158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
Fixes golang/go#50805 Change-Id: Icdd2835b1626240faf61936288f279570c873158 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614 Trust: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
greplogs --dashboard -md -l -e 'FAIL: TestClientAuthMaxAuthTriesPublicKey.*\n(?: .*\n)* .*An established connection was aborted' --since=2021-01-01
2022-01-25T00:39:08-5e0467b-16d6a52/windows-arm64-10
2022-01-11T17:13:50-e495a2d-1abe9c1/windows-arm64-10
2022-01-10T20:53:01-e495a2d-55d10ac/windows-arm64-10
2021-12-04T01:07:28-5770296-fa88ba1/windows-amd64-longtest
2021-12-01T10:19:34-ae814b3-0e1d553/windows-arm64-10
2021-11-29T00:58:50-ae814b3-1ea4d3b/windows-arm64-10
2021-11-20T00:37:28-ae814b3-d2f4c93/windows-amd64-longtest
2021-10-26T17:10:45-089bfa5-76cef81/windows-arm64-10
2021-09-17T23:21:29-c084706-f01721e/windows-arm64-10
2021-09-17T22:19:21-c084706-3fa35b5/windows-amd64-2016
2021-07-07T22:29:01-5ff15b2-5c59e11/windows-amd64-longtest
2021-03-17T00:18:28-e6e6c4f-63b0a0a/windows-amd64-longtest
2021-03-13T18:09:48-5ea612d-4bd4dfe/windows-amd64-longtest
(CC @golang/security)
The text was updated successfully, but these errors were encountered: