FrendsFrends
All ideas

Frends.SFTP: allow restricting key exchange and encryption algorithms

The SFTP tasks (DownloadFiles, UploadFiles, etc.) currently let the user force the host key algorithm via Connection.HostKeyAlgorithm, but there is no way to control the key exchange or encryption algorithms. These are negotiated using SSH.NET’s default preference order, which can result in a weaker algorithm than the server supports. Example: against an OpenSSH 9.9 server that supports aes256-gcm, chacha20-poly1305 and aes256-ctr, the task negotiates aes128-ctr, because SSH.NET lists it first. The same applies to key exchange: SSH.NET 2025.1.0 supports mlkem768x25519-sha256, but curve25519-sha256 is used instead. For environments with security or compliance requirements (e.g. mandatory 256-bit encryption or post-quantum key exchange), this means we either have to ask the server owner to restrict their configuration, which affects all their clients, or maintain a fork of the task. Proposed solution: Add optional parameters to the Connection settings, for example: KeyExchangeAlgorithms: ordered list of allowed key exchange algorithms EncryptionAlgorithms: ordered list of allowed ciphers optionally MacAlgorithms When a parameter is set, the task would restrict and reorder the corresponding ConnectionInfo collection, so that negotiation follows the given order and fails if none of the listed algorithms is supported. When it is empty, the current behaviour (SSH.NET defaults) stays unchanged, so the change is backward compatible.

Activity · 0
No comments yet. Be the first to weigh in.

More in Task Feature