Apache MINA SSHD 3.0.0-M2
This is the second milestone pre-release on the way to a new major version Apache MINA SSHD 3.0.0.
Like regular releases it is available in Maven Central and in the Apache repositories; the Apache source release is also at the usual location.
See the change notes for what has changed with respect to version 2.
The focus in this milestone was on the use of cryptography. Bundles sshd-common and sshd-osgi have become multi-release JARs. Apache MINA SSHD 3.0.0-M2 now supports
- On Java11+: using Java's built-in ChaCha20 cipher for the
chacha20-poly1305@openssh.comSSH cipher, which bring a hug speed-up. - On Java15+: using Java's built-in ed25519 private/public key implementation instead on Bouncy Castle or net.i2p.crypto:eddsa.
- On Java24+: using Java's built-in ML-KEM post-quantum key exchange method instead of Bouncy Castle.
Version 3 of Apache MINA SSHD is not API compatible with version 2. API comparison reports and a (very high-level and tentative) roadmap are available on the 3.0.0 development website.
This pre-release has passed all our quality and regression tests, just like any other release. We encourage interested parties to try this pre-release. Be aware that APIs might change in future milestone pre-releases.
Full Changelog since 3.0.0-M1: https://github.com/apache/mina-sshd/compare/sshd-3.0.0-M1...sshd-3.0.0-M2
Apache MINA SSHD 3.0.0-M1
This is a first milestone pre-release on the way to a new major version Apache MINA SSHD 3.0.0.
Like regular releases it is available in Maven Central and in the Apache repositories; the Apache source release is also at the usual location.
See the change notes for what has changed with respect to version 2. In short, we have refactored the implementation of the SSH transport layer, which then enabled providing support for client-side proxies. In doing so we've technically broken a lot of APIs, but the impact on existing code bases using the library should be small in practice. API comparison reports and a (very high-level and tentative) roadmap are available on the 3.0.0 development website.
This pre-release has passed all our quality and regression tests, just like any other release. We encourage interested early adopters to try this pre-release. Be aware that APIs might change in future milestone pre-releases.
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.16.0...sshd-3.0.0-M1
Apache MINA SSHD 2.16.0
- bugfix: fix cert auth failed bug by @liuziyu1226 in https://github.com/apache/mina-sshd/pull/660
- GH-664: Skip MAC negotiation if an AEAD cipher was negotiated by @tomaswolf in https://github.com/apache/mina-sshd/pull/666
- GH-663: Fix a race in IoSession creation by @tomaswolf in https://github.com/apache/mina-sshd/pull/667
- Also test sshd-mina using mina-core 2.2.4 by @tomaswolf in https://github.com/apache/mina-sshd/pull/681
- ScpShell fixes; SFTP append mode for buggy servers by @tomaswolf in https://github.com/apache/mina-sshd/pull/696
- fix sources.jar Reproducible Builds issue by @hboutemy in https://github.com/apache/mina-sshd/pull/695
- GH-700: Fix race in AbstractCloseable.doCloseImmediately() by @tomaswolf in https://github.com/apache/mina-sshd/pull/702
- GH-705: Make ChannelToPortHandler accessible to user code by @tomaswolf in https://github.com/apache/mina-sshd/pull/707
- GH-709: Handle keep-alive channel messages sent by an old OpenSSH server by @tomaswolf in https://github.com/apache/mina-sshd/pull/710
- GH-727: supply default port for proxyJump if no HostConfigEntry by @tomaswolf in https://github.com/apache/mina-sshd/pull/730
- GH-733: Fix SftpRemotePathChannel.transferTo by @tomaswolf in https://github.com/apache/mina-sshd/pull/734
- [GH-725] Added commandTimeoutMillis in executeRemoteCommand by @raajeive in https://github.com/apache/mina-sshd/pull/726
- GH-774: Fix WritePendingException by @tomaswolf in https://github.com/apache/mina-sshd/pull/775
- #771 Avoid NoClassDefFoundError: net/i2p/crypto/eddsa/EdDSAPublicKey by @rde-infologic in https://github.com/apache/mina-sshd/pull/773
- [GH-516] Fix filesystem-id parsing in getFileSystem(URI) by @ago1024 in https://github.com/apache/mina-sshd/pull/766
- GH-754: Don't close DefaultForwarder on bind error by @tomaswolf in https://github.com/apache/mina-sshd/pull/776
- Close repository after usage in GitPackCommand by @kwin in https://github.com/apache/mina-sshd/pull/794
- Trigger ClientChannelEvent.Timeout and ClientSessionEvent.TIMEOUT independently to host's program cycle times by @fersaru in https://github.com/apache/mina-sshd/pull/790
- @liuziyu1226 made their first contribution in https://github.com/apache/mina-sshd/pull/660
- @raajeive made their first contribution in https://github.com/apache/mina-sshd/pull/726
- @rde-infologic made their first contribution in https://github.com/apache/mina-sshd/pull/773
- @ago1024 made their first contribution in https://github.com/apache/mina-sshd/pull/766
- @kwin made their first contribution in https://github.com/apache/mina-sshd/pull/794
- @fersaru made their first contribution in https://github.com/apache/mina-sshd/pull/790
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.15.0...sshd-2.16.0
Apache MINA SSHD 2.15.0
- GH-618: Fix reading an OpenSshCertificate from a Buffer by @tomaswolf in https://github.com/apache/mina-sshd/pull/619
- Add interface to configure details of JGit's pack implementation by @JohnnyJayJay in https://github.com/apache/mina-sshd/pull/617
- ML-KEM key exchanges using Bouncy Castle 1.79 by @tomaswolf in https://github.com/apache/mina-sshd/pull/629
- GH-628: Fix reading directories with trailing blanks in the name by @tomaswolf in https://github.com/apache/mina-sshd/pull/630
- GH-626: Enable Streaming.Async for ChannelDirectTcpip by @tomaswolf in https://github.com/apache/mina-sshd/pull/631
- Sftp server ‘ls’ command timeout by @Main-Tomi in https://github.com/apache/mina-sshd/pull/634
- GH-636: Handle unknown key types in known_hosts by @tomaswolf in https://github.com/apache/mina-sshd/pull/638
- GH-643: provide interfaces for caching file attributes on paths by @tomaswolf in https://github.com/apache/mina-sshd/pull/645
- Bouncy Castle EdDSA / Ed25519 Support by @ianjoneill in https://github.com/apache/mina-sshd/pull/639
- Abstract revoked key handling in KnownHostsServerKeyVerifier by @joeljohansson99 in https://github.com/apache/mina-sshd/pull/653
- @JohnnyJayJay made their first contribution in https://github.com/apache/mina-sshd/pull/617
- @Main-Tomi made their first contribution in https://github.com/apache/mina-sshd/pull/634
- @ianjoneill made their first contribution in https://github.com/apache/mina-sshd/pull/639
- @joeljohansson99 made their first contribution in https://github.com/apache/mina-sshd/pull/653
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.14.0...sshd-2.15.0
SSHD 2.14.0
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.13.2...sshd-2.14.0
- GH-524 Performance improvements
- GH-533 Fix multi-step authentication
- GH-582 Fix filtering in
NamedFactory - GH-587 Prevent
NullPointerExceptionon closed channel inNettyIoSession - GH-590 Better support for FIPS
- GH-597 Pass on
CharsetinClientSession.executeRemoteCommand()
- New utility methods
SftpClient.put(Path localFile, String remoteFileName)andSftpClient.put(InputStream in, String remoteFileName)facilitate SFTP file uploading.
GH-590 Better support for FIPS
Besides fixing a bug with bc-fips (the RandomGenerator class exists in normal Bouncy Castle, but not in the FIPS version, but Apache MINA sshd referenced it even if only bc-fips was present), support was improved for running in an environment restricted by FIPS.
There is a new system property org.apache.sshd.security.fipsEnabled. If set to true, a number of crypto-algorithms not approved by FIPS 140 are disabled:
- key exchange methods sntrup761x25519-sha512, sntrup761x25519-sha512@openssh.com, curve25519-sha256, curve25519-sha256@libssh.org, curve448-sha512.
- the chacha20-poly1305 cipher.
- the bcrypt KDF used in encrypted private key files in OpenSSH format.
- all ed25519 keys and signatures.
Additionally, the new "SunJCEWrapper" SecurityProviderRegistrar (see below) and the EdDSASecurityProviderRegistrar are disabled, and the BouncyCastleScurityProviderRegistrar looks only for the "BCFIPS" security provider, not for the normal "BC" provider.
If the system property is not set to true, FIPS mode can be enabled programmatically by calling SecurityUtils.setFipsMode() before any other call to Apache MINA sshd.
There is a new SecurityProviderRegistrar that is registered by default if there is a SunJCE security provider. It uses the AES and HmacSHA* implementations from SunJCE even if Bouncy Castle is also registered. SunJCE has native implementations, whereas Bouncy Castle may not.
The new registrar has the name "SunJCEWrapper" and can be configured like any other registrar. It can be disabled via the system property org.apache.sshd.security.provider.SunJCEWrapper.enabled=false. It is also disabled in FIPS mode (see above).
GH-582 Fix filtering in NamedFactory
The methods NamedFactory.setupBuiltinFactories(boolean ignoreUnsupported, ...) and NamedFactory.setupTransformedFactories(boolean ignoreUnsupported, ...) had a bug that gave the "ignoreUnsupported" parameter actually the meaning of "include unsupported".
This was fixed in this release, but existing code calling these or one of the following methods:
BaseBuilder.setUpDefaultMacs(boolean ignoreUnsupported)BaseBuilder.setUpDefaultCiphers(boolean ignoreUnsupported)ClientBuilder.setUpDefaultCompressionFactories(boolean ignoreUnsupported)ClientBuilder.setUpDefaultKeyExchanges(boolean ignoreUnsupported)ClientBuilder.setUpDefaultSignatureFactories(boolean ignoreUnsupported)ServerBuilder.setUpDefaultCompressionFactories(boolean ignoreUnsupported)ServerBuilder.setUpDefaultKeyExchanges(boolean ignoreUnsupported)ServerBuilder.setUpDefaultSignatureFactories(boolean ignoreUnsupported)- any of the methods starting with
SshConfigFileReader.configure SshClientConfigFileReader.configure(...)SshServerConfigFileReader.configure(...)
should be reviewed:
- if the method is called with parameter value
true, the result will no longer include unsupported algorithms. Formerly it wrongly did. - if the method is called with parameter value
false, the result may include unsupported algorithms. Formerly it did not.
So if existing code used parameter value false to ensure it never got unsupported algorithms, change it to true.
- GH-536 The project now requires JDK 17 at build time, while the target runtime still remains unchanged to support JDK 8.
SSHD 2.13.2
- GH-525: Fix sntrup761x25519-sha512 by @tomaswolf in https://github.com/apache/mina-sshd/pull/528
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.13.1...sshd-2.13.2
SSHD 2.13.1
This release does not contain any code changes. It is solely to rectify the issue that the 2.13.0 release encountered during the release process, where the source jars were not created.
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.13.0...sshd-2.13.1
The 2.13.0 release notes are available at https://github.com/apache/mina-sshd/releases/tag/sshd-2.13.0
SSHD 2.13.0
- GH-318: Handle cascaded proxy jumps by @tomaswolf in #512
- GH-427: Read initial ACK on channel open prior to direct stream upload & close streams prior to exit code handling by @TerraNibble in #464
- GH-455: ensure BaseCipher.update() fulfills the contract by @tomaswolf in #463
- GH-470: Synchronize not thread safe java.security.KeyPairGenerator.generateKe… by @zakharovsergey1000 in #467
- GH-476: Fix Android detection false negative by @wh0
- GH-475: Switch uses of JSch library to the com.github.mwiede:jsch fork by @Alex-Vol-Amz
- GH-472: change client start condition in sshd-spring-sftp by @alwaystom
- GH-489: sftp readdir: determine file type from longname by @tomaswolf in #491
- GH-486: Add missing U2F {ed25519,ecdsa}-sk public key equality methods by @lf-
- SSHD-1237 Handle keep-alive channel requests by @tomaswolf in #492
- GH-494: Nio2Session improvements by @evgeny-pasynkov
- GH-468: Handle excess data in SFTP read requests by @tomaswolf in #495
- GH-498: Implement the "sntrup761x25519-sha512@openssh.com" KEX method by @tomaswolf
- GH-500: SftpFileSystemProvider: close SftpClient on exception by @tomaswolf in #501
- GH-504: Pass reason to sessionNegotiationEnd by @duco-lw in #505
- GH-461: Fix heartbeats with
wantReply=trueby @tomaswolf in #507 - GH-493: Fix arcfour128 and arcfour256 ciphers (regression in 2.2.0)
- GH-509: SFTP v[456] client: validate attribute flags
- GH-510: Fix class name in BuiltinIoServiceFactoryFactories (regression in 2.6.0)
The key exchange method sntrup761x25519-sha512@openssh.com is now available if the Bouncy Castle library is available.
This uses a post-quantum key encapsulation method (KEM) to make key exchange future-proof against quantum attacks. More information can be found in IETF Memo Secure Shell (SSH) Key Exchange Method Using Hybrid Streamlined NTRU Prime sntrup761 and X25519 with SHA-512: sntrup761x25519-sha512.
GH-318 Handle cascaded proxy jumps
Proxy jumps can be configured via host configuration entries in two ways. First, proxies can be chained directly by specifiying several proxies in one ProxyJump directive:
Host target
Hostname somewhere.example.org
User some_user
IdentityFile ~/.ssh/some_id
ProxyJump jumphost2, jumphost1
Host jumphost1
Hostname jumphost1@example.org
User jumphost1_user
IdentityFile ~/.ssh/id_jumphost1
Host jumphost2
Hostname jumphost2@example.org
User jumphost2_user
IdentityFile ~/.ssh/id_jumphost2
Connecting to server target will first connect to jumphost1, then tunnel through to jumphost2, and finally tunnel to target. So the full connection will be client→jumphost1→jumphost2→target.
Such proxy jump chains were already supported in Apache MINA SSHD.
Newly, Apache MINA SSHD also supports cascading proxy jumps, so a configuration like
Host target
Hostname somewhere.example.org
User some_user
IdentityFile ~/.ssh/some_id
ProxyJump jumphost2
Host jumphost1
Hostname jumphost1@example.org
User jumphost1_user
IdentityFile ~/.ssh/id_jumphost1
Host jumphost2
Hostname jumphost2@example.org
ProxyJump jumphost1
User jumphost2_user
IdentityFile ~/.ssh/id_jumphost2
also works now, and produces the same connection client→jumphost1→jumphost2→target.
It is possible to mis-configure such proxy jump cascades to have loops. (For instance, if host jumphost1 in the above example had a ProxyJump jumphost2 directive.) To catch such misconfigurations, Apache MINA SSHD imposes an upper limit on the total number of proxy jumps in a connection. An exception is thrown if there are more than CoreModuleProperties.MAX_PROXY_JUMPS proxy jumps in a connection. The default value of this property is 10. Most real uses of proxy jumps will have one or maybe two proxy jumps only.
GH-461 Fix heartbeats with wantReply=true
The client-side heartbeat mechanism has been updated. Such heartbeats are configured via the CoreModuleProperties.HEARTBEAT_INTERVAL property. If this interval is > 0, heartbeats are sent to the server.
Previously these heartbeats could also be configured with a CoreModuleProperties.HEARTBEAT_REPLY_WAIT timeout. If the timeout was <= 0, the client would just send heartbeat requests without expecting any answers. If the timeout was > 0, the client would send requests with a flag indicating that the server should reply. The client would then wait for the specified duration for the reply and would terminate the connection if none was received.
This mechanism could cause trouble if the timeout was fairly long and the server was slow to respond. A timeout longer than the interval could also delay subsequent heartbeats.
The CoreModuleProperties.HEARTBEAT_REPLY_WAIT property is now deprecated.
There is a new configuration property CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX instead. It defines a limit for the number of heartbeats sent without receiving a reply before a session is terminated. If the value is <= 0, the client still sends heartbeats without expecting any reply. If the value is > 0, the client will request a reply from the server for each heartbeat message, and it will terminate the connection if the number of unanswered heartbeats reaches CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX.
This new way to configure heartbeats aligns with the OpenSSH configuration options ServerAliveInterval and ServerAliveCountMax.
For compatibility with older configurations that explicitly define CoreModuleProperties.HEARTBEAT_REPLY_WAIT, the new code maps this to the new configuration (but only if CoreModuleProperties.HEARTBEAT_INTERVAL > 0 and the new property CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX has not been set) by setting CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX to
CoreModuleProperties.HEARTBEAT_REPLY_WAIT<= 0:CoreModuleProperties.HEARTBEAT_NO_REPLY_MAX = 0- otherwise:
(CoreModuleProperties.HEARTBEAT_REPLY_WAIT / CoreModuleProperties.HEARTBEAT_INTERVAL) + 1.
GH-468 SFTP: validate length of data received: must not be more than requested
SFTP read operations now check the amount of data they get back. If it's more than requested an exception is thrown. SFTP servers must never return more data than the client requested, but it appears that there are some that do so. If property SftpModuleProperties.TOLERATE_EXCESS_DATA is set to true, a warning is logged and such excess data is silently discarded.
The AES-CBC ciphers aes128-cbc, aes192-cbc, and aes256-cbc have been removed from the default list of cipher algorithms that a server proposes in the key exchange. OpenSSH has removed these cipher algorithms from the server proposal in 2014, and has removed them from the client proposal in 2017.
The cipher implementations still exist but they are not enabled by default. Existing code that explicitly sets the cipher factories is unaffected. Code that relies on the default settings will newly create a server that does not support the CBC-mode ciphers. To enable the CBC-mode ciphers, one can use for instance
SshServer server = ServerBuilder.builder()
...
.cipherFactories(BuiltinFactory.setUpFactories(false, BaseBuilder.DEFAULT_CIPHERS_PREFERENCES));
...
.build();
For the SSH client, the CBC ciphers are still enabled by default to facilitate connecting to legacy servers. We plan to remove the CBC ciphers from the client's defaults in the next release.
- @zakharovsergey1000 made their first contribution in https://github.com/apache/mina-sshd/pull/467
- @wh0 made their first contribution in https://github.com/apache/mina-sshd/pull/476
- @Alex-Vol-Amz made their first contribution in https://github.com/apache/mina-sshd/pull/475
- @alwaystom made their first contribution in https://github.com/apache/mina-sshd/pull/472
- @lf- made their first contribution in https://github.com/apache/mina-sshd/pull/486
- @TerraNibble made their first contribution in https://github.com/apache/mina-sshd/pull/464
- @duco-lw made their first contribution in https://github.com/apache/mina-sshd/pull/505
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.12.1...sshd-2.13.0
Apache MINA SSHD 2.12.1
- GH-458 Singleton thread pool for kex message handler flushing
- SSHD-1338 Restore binary compatibility with 2.9.2
- Fix link by @swiedenfeld in https://github.com/apache/mina-sshd/pull/454
- SSHD-1338 Restore binary compatibility with 2.9.2 by @gnodet in https://github.com/apache/mina-sshd/pull/456
- Use a singleton threadpool for kex message handler flushing by @FliegenKLATSCH in https://github.com/apache/mina-sshd/pull/459
- @swiedenfeld made their first contribution in https://github.com/apache/mina-sshd/pull/454
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.12.0...sshd-2.12.1
Apache MINA SSHD 2.12.0
- GH-428/GH-392 SCP client fails silently when error signalled due to missing file or lacking permissions
- GH-434 Ignore unknown key types from agent or in OpenSSH host keys extension
- GH-429 Support GIT protocol-v2
- GH-445 OpenSSH "strict key exchange" protocol extension (CVE-2023-48795 mitigation)
Following GH-428/GH-392 a new handleReceiveCommandAckInfo method has been added to enable users to inspect acknowledgements of a receive related command. The user is free to inspect the command that was attempted as well as the response code and decide how to handle it - including even throwing an exception if OK status (if this makes sense for whatever reason). The default implementation checks for ERROR code and throws an exception if so.
GH-445 implements an extension to the SSH protocol introduced in OpenSSH 9.6. This "strict key exchange" extension hardens the SSH key exchange against the "Terrapin attack" (CVE-2023-48795). The extension is active if both parties announce their support for it at the start of the initial key exchange. If only one party announces support, it is not activated to ensure compatibility with SSH implementations that do not implement it. Apache MINA sshd clients and servers always announce their support for strict key exchange.
- @evgeny-pasynkov made their first contribution in https://github.com/apache/mina-sshd/pull/424
Full Changelog: https://github.com/apache/mina-sshd/compare/sshd-2.11.0...sshd-2.12.0