sshnet / sshnet/SSH.NET

StackOverflow exception when receiving partial success with private key

Open
#165 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

When attempting to connect to an SFTP server using multiple authentication methods (a username/ password and username/ private key combination) We occasionally have a partial success message from one part of this then a failure from the other. When this happens we get stuck in an infinite loop where the method TryAuthenticate is called from ClientAuthentication continually until we get a StackOverflow exception.

The server on the other end just receives a huge number of login attempt requests.

I have attached our stack trace and the logs from the other server.
stack trace.xlsx
server logs.txt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached stack trace and server logs, then inspect ClientAuthentication and TryAuthenticate to trace how partial success is handled across username/password and username/private-key methods. Reproduce the authentication sequence and verify that partial success terminates or advances without recursively repeating attempts or causing a StackOverflowException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
authentication, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.