-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Sftp lacks support for ssh-ed25519 due to unmaintained library #3572
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
According to README for the project you mention: https://github.com/mwiede/jsch, it is just "drop in replacement". We probably will think for the future version to switch such a dependency: technically you should not care what SSH library we use underneath, but unfortunately we can't do that in the current point release. But definitely this is not a bug. WDYT? Thank you for understanding! |
Thanks for the tip with swapping dependencies. I have no hard feeling about categorization of this issue. For keeping it on the radar I'd rather keep it open as a feature request. But is there even a need to break any compatibility if the official Spring module could avoid this by just swapping the dependency? Or are there other sftp changes planned anyway justifying a breaking change? |
Right, as I said: there is a workaround for the current version. Hope that all clears things. |
Openssh latest release has officially dropped support for RSA-SHA1. Please reconsider releasing a |
As I said before: there is a workaround which does not break the framework code and does not require a ode change on your side: you just exclude Thank for understanding. |
Hi @artembilan I see that version |
I didn't look into an Apache MINA for SSH support, but if that what is done in Spring Cloud Config and looks like they did that instead of migrating to a forked lib, then we indeed can go ahead and fix this issue same way - replace JSCH with Apache MINA. |
It looks like we already have an |
Fixes spring-projects#3572 * Rework SFTP module from the JSch API to more modern `sshd-sftp` * Migrate generics of most API from `ChannelSftp.LsEntry` to the `SftpClient.DirEntry` * Rework `DefaultSftpSessionFactory` to deal with an `SshClient` and create `SftpClient` wrapped to the `SftpSession` * Implement a `ResourceKnownHostsServerKeyVerifier` to load `known-hosts` from any possible resource * Implement an expected `SftpSession.list()` with just file name to take or pattern matching * Remove some unused tests and their config * Remove tests for custom `UserInfo` since we don't provide any custom out-of-the-box * Test a new `ResourceKnownHostsServerKeyVerifier` against default `known-hosts` file
Fixes spring-projects#3572 * Rework SFTP module from the JSch API to more modern `sshd-sftp` * Migrate generics of most API from `ChannelSftp.LsEntry` to the `SftpClient.DirEntry` * Rework `DefaultSftpSessionFactory` to deal with an `SshClient` and create `SftpClient` wrapped to the `SftpSession` * Implement a `ResourceKnownHostsServerKeyVerifier` to load `known-hosts` from any possible resource * Implement an expected `SftpSession.list()` with just file name to take or pattern matching * Remove some unused tests and their config * Remove tests for custom `UserInfo` since we don't provide any custom out-of-the-box * Test a new `ResourceKnownHostsServerKeyVerifier` against default `known-hosts` file
* GH-3572: Migrate SFTP from `jsch` to `sshd-sftp` Fixes #3572 * Rework SFTP module from the JSch API to more modern `sshd-sftp` * Migrate generics of most API from `ChannelSftp.LsEntry` to the `SftpClient.DirEntry` * Rework `DefaultSftpSessionFactory` to deal with an `SshClient` and create `SftpClient` wrapped to the `SftpSession` * Implement a `ResourceKnownHostsServerKeyVerifier` to load `known-hosts` from any possible resource * Implement an expected `SftpSession.list()` with just file name to take or pattern matching * Remove some unused tests and their config * Remove tests for custom `UserInfo` since we don't provide any custom out-of-the-box * Test a new `ResourceKnownHostsServerKeyVerifier` against default `known-hosts` file * * Some tests improvements * * Improve generics handling for `FileUtils`
Is there a migration guide on how to migrate the jsch features to mina sshd somewhere (maybe not SI as its more of an abstraction) as seems right now for us easier to move to the drop in replacement |
Interesting Thread. |
We are not experts here of the SFTP protocol, neither those JSCH and MINA projects.
We also had some conversion like this before though: #8559 |
Thanks yes in jsch we had a custom sftpProxyCommand to do the jump host call . Sure will check in mina forums on this and trying via hostConfig (though not found a good example yet will post if works) . Also yes thanks these threads helped to work with |
In what version(s) of Spring Integration are you seeing this issue?
For example:
5.5.0 and all previous version
Describe the bug
The DefaultSftpSessionFactory does not support host keys of type
ssh-ed25519
.If it tries to validate one it will return with 2 messages:
However: If all unknown keys are accepted, the connection can be established. This might cause people to rather not validate keys because of convenience and would open the door for vulnerabilities.
To Reproduce
Start an SFTP server using
ssh-ed25519
based host keys. In my case I'm using the docker imageatmoz/sftp
.Connect to the server via sftp cli and accept the key.
Use the known hosts to instantiate a SftRemoteFileTemplate.
Expected behavior
The host key is properly validated and used.
Background information
The reason for this issue is the lack of support for this key type in the JSch library. Furthermore the library seems to be no longer maintained as nobody answers on maintenance requests on the mailing list.
The lack of key type support will be a security issue in the future. More details can also be found here: http://www.matez.de/index.php/2020/06/22/the-future-of-jsch-without-ssh-rsa/
Several forks such as https://github.com/mwiede/jsch have appeared that resolve these issues. Maybe it's possible to swap the dependency while keeping compatibility.
The text was updated successfully, but these errors were encountered: