Skip to content

Releases: darinkes/SshNet.Agent

2026.0.0.0

Choose a tag to compare

@darinkes darinkes released this 14 Aug 07:10

SSH.NET extension to authenticate via the OpenSSH agent and PuTTY Pageant.

A security release on top of 2024.2.0.5. This release requires SSH.NET 2026.0.0 or newer.

Security

  • SSH.NET raised to [2026.0.0,2027.0) (GHSA-q939-rpr3-3284, CVE-2026-48798, high). SSH.NET <= 2025.1.0 lets a malicious, compromised or MITM SCP server write files outside the target directory during a recursive ScpClient.Download.

    SshNet.Agent never calls ScpClient, so the extension itself was not exploitable. But NuGet resolves the floor of a version range, so consumers who did not pin SSH.NET themselves pulled the vulnerable 2024.2.0 transitively and got an NU1903 warning for it. Raising the floor is the only lever the package has.

Breaking

  • SSH.NET 2024.x and 2025.x are no longer supported. Consumers pinned to those versions cannot take this release; the package version tracks the SSH.NET line it now requires.
  • The lowest-supported-SSH.NET CI legs move to 2026.0.0 accordingly.

Thanks to @gleox for the report and the fix (#56, #57).

NuGet: https://www.nuget.org/packages/SshNet.Agent/2026.0.0 (NuGet normalises the 2026.0.0.0 tag to 2026.0.0)

Full changelog: 2024.2.0.5...2026.0.0.0

2024.2.0.5

Choose a tag to compare

@darinkes darinkes released this 21 Jul 11:33

SSH.NET extension to authenticate via the OpenSSH agent and PuTTY Pageant.

A hardening-focused release on top of 2024.2.0.4, adding smartcard support and bounding every synchronous transport path.

Features

  • PKCS#11 / smartcard keys — add and remove keys held on a PKCS#11 token through the agent (ssh-add -s / -e): implements SSH_AGENTC_ADD_SMARTCARD_KEY, ..._ADD_SMARTCARD_KEY_CONSTRAINED and ..._REMOVE_SMARTCARD_KEY, sync and async, with the same lifetime/confirm constraints as regular keys.
  • sk certificate identities — FIDO / security-key identities that also carry an OpenSSH certificate (sk-*-cert-v01@openssh.com).

Hardening

  • Synchronous response length is now bounded — the sync receive path reads the whole framed response and applies OpenSSH's AGENT_MAX_MSGLEN cap (the async path already did), so a malformed or malicious length prefix is refused instead of driving an unbounded allocation.
  • Inner string lengths in agent messages are validated — length prefixes that overrun the message are rejected.
  • Legacy Pageant WM_COPYDATA transport is bounded — the 8 KB shared-memory fallback path.
  • Synchronous unix-socket connect is bounded — a stalled connect fails fast instead of hanging (covered by a regression test).
  • Invalid pipe names are tolerated when locating Pageant's OpenSSH named pipe.

Packaging / CI / Docs

  • Documented minting certificates with SshNet.Keygen (pairs with SshNet.Keygen 2024.2.0.4).
  • Dependabot: actions/setup-dotnet 5 → 6 and a nuget minor/patch group bump.

NuGet: https://www.nuget.org/packages/SshNet.Agent/2024.2.0.5

Full changelog: 2024.2.0.4...2024.2.0.5

2024.2.0.4

Choose a tag to compare

@darinkes darinkes released this 16 Jul 07:44

SSH.NET extension to authenticate via the OpenSSH agent and PuTTY Pageant.

First stable release since 2024.2.0.1, finalizing the 2024.2.0.2–.4-beta line.

Features

  • FIDO / security keys (sk-ssh-ed25519@openssh.com, sk-ecdsa-sha2-nistp256@openssh.com) — the agent drives the authenticator (touch / PIN); the private key never leaves the hardware
  • OpenSSH certificate identities (*-cert-v01@openssh.com)
  • Key constraints — lifetime (ssh-add -t) and confirm-on-use (ssh-add -c)
  • Agent locking / unlocking (ssh-add -x / -X)
  • Full async API for every operation, including constrained adds and lock/unlock
  • SshAgentPrivateKey.Comment is now surfaced for every identity, including FIDO keys
  • Pageant talks over its OpenSSH named pipe when available (real async I/O, no 8 KB WM_COPYDATA limit), falling back to WM_COPYDATA automatically

Improvements

  • Prefer RSA SHA-2 (rsa-sha2-512 / rsa-sha2-256); legacy ssh-rsa (SHA-1) offered only when explicitly enabled
  • Added a .NET 8.0 target
  • Unsupported key types are skipped when listing identities
  • Typed exceptions instead of bare System.Exception
  • Connect/read/write timeouts and Windows named-pipe transport fixes

Packaging / CI / Docs

  • NuGet trusted publishing (OIDC)
  • Fully documented public API (missing docs fail the build)
  • Migrated to .slnx, added Dependabot, modernized the sample (System.CommandLine)
  • Protocol-level fake-agent unit tests plus real-world tests against ssh-agent, Pageant and a real sshd

NuGet: https://www.nuget.org/packages/SshNet.Agent/2024.2.0.4

Full changelog: 2024.2.0.1...2024.2.0.4

2024.2.0.4-beta

2024.2.0.4-beta Pre-release
Pre-release

Choose a tag to compare

@darinkes darinkes released this 14 Jul 08:45

⚠️ Breaking changes

  • Errors while talking to the agent now throw SshAgentException / SshAgentFailureException instead of bare System.Exception; adding an unsupported key type throws NotSupportedException up front.
  • RSA identities are offered as rsa-sha2-512/rsa-sha2-256 (RFC 8332). The legacy SHA-1 ssh-rsa is only offered with the new IncludeLegacySshRsa opt-in — this fixes "Too many authentication failures" with multiple RSA keys (#13) and works with OpenSSH 8.8+, which rejects ssh-rsa signatures.
  • RequestIdentities() skips key types this library cannot use (e.g. sk-* FIDO keys) instead of failing the whole listing.
  • PageantSocketStream is now internal.
  • The SSH.NET dependency declares the range [2024.2.0, 2026.0); compatibility with SSH.NET 2025.1.0 is verified by compiling against it and running the full test suite with it.

New features

  • OpenSSH certificates: certificate identities held by the agent (*-cert-v01@openssh.com) authenticate against servers that trust the CA, and AddIdentity adds key+certificate pairs (PrivateKeyFile with a certificate).
  • Key constraints: AddIdentity(keyFile, lifetime, confirm) like ssh-add -t/-c.
  • Lock/Unlock: agent.Lock(passphrase) / agent.Unlock(passphrase) like ssh-add -x/-X.
  • Async API: RequestIdentitiesAsync, AddIdentityAsync, RemoveIdentityAsync, RemoveIdentitiesAsync, RemoveAllIdentitiesAsync, all taking a CancellationToken.
  • net8.0 target in addition to net48/netstandard2.0/netstandard2.1.

Fixes

  • Windows named pipes: reads and writes now honor the configured timeout — a stalled agent no longer blocks the caller forever — and the full \\.\pipe\openssh-ssh-agent path is accepted.
  • Key comments are encoded and decoded as UTF-8 on every framework.
  • Correct Stream.Dispose pattern in the transport streams; the connection is reliably closed.
  • Clear EndOfStreamException when the agent closes the connection mid-message.

Packaging

  • README and XML documentation ship with the package; missing docs on the public API are a build error.
  • SourceLink with deterministic CI builds and snupkg symbol packages — consumers can step into the library.
  • Publishing switched to NuGet trusted publishing (no stored API key).

Tests

  • Protocol-level golden-byte tests against an in-process fake agent run on every platform without prerequisites.
  • Real-world tests cover OpenSSH ssh-agent and PuTTY Pageant against a real sshd, including certificate authentication against a CA-trusting server (TrustedUserCAKeys).