Skip to content

Releases

v3.1.3

Choose a tag to compare

@inureyes inureyes released this 22 Nov 17:41

New Features

None

Improvements

  • Replaced the deprecated serde_yaml with serde-saphyr 2.1.1, a YAML parser written in safe Rust, which removed unsafe-libyaml (RUSTSEC-2024-0449) from the dependency tree (#358).
  • Replaced the unmaintained chrono with jiff for audit log timestamps, TUI and interactive clock display, and output file names. Audit JSON timestamps are byte-identical to before (RFC 3339 UTC with a Z suffix and 0, 3, 6 or 9 fractional digits), and records written by earlier versions still deserialize (#363, #364).

Bug Fixes

None

CI/CD Improvements

  • Moved the aarch64-apple-darwin release build from the retired macos-14 runner to macos-26, which had left the v3.1.2 macOS leg, publish and Homebrew jobs unscheduled. The binaries still target macOS 11.0 (#359).
  • Normalized the App Store Connect notarization key to canonical PKCS#8 PEM before submitting it, since the macOS 26 notarytool rejected the stored secret with invalidPEMDocument. Failures now report the key's shape without printing key material (#360).

Technical Details

  • Added a serde helper in src/server/audit/timestamp.rs that writes audit timestamps with chrono's shortest exact fractional width, and documented the format in docs/audit-logging.md (#364).
  • The OpenTelemetry exporter converts timestamps with SystemTime::try_from and falls back to the current time (#364).

Dependencies

  • Bumped russh to 0.65.2 and pinned ssh-key to =0.7.0-rc.12, which resolves rsa 0.10.0 and pkcs1 0.8.0 stable and cleared RUSTSEC-2023-0071; the suppression was removed from .cargo/audit.toml (#361, #362).
  • Replaced serde_yaml 0.9 with serde-saphyr 2.1.1 (#358).
  • Replaced chrono 0.4 with jiff 1.0.1 (#364).
  • Bumped nix to 0.32 with no code changes, and refreshed the lockfile within existing requirements, including russh 0.65.3, clap 4.6.9, serde-saphyr 2.2.0, prost 0.14.6 and jiff 1.0.2 (#365).

Breaking Changes

  • YAML configuration files that use merge keys (<<) now have them applied; serde_yaml ignored them. Some inputs serde_yaml rejected now load, including YAML 1.1 booleans such as yes, quoted numbers and underscored integers. Other configurations parse to the same values (#358).

Known Issues

  • Host keys presented during rekey were still not re-verified, pending upstream russh support (#336).
  • Multihop destination-constrained agent authentication remained blocked because russh cannot send publickey-hostbound-v00@openssh.com (#327).
  • cargo deny still reported RUSTSEC-2026-0543 (chrono) through russh-sftp 3.0.1, which needs an upstream change.
  • nix 0.31.4 remained in the tree through russh-cryptovec 0.62.0 and rustyline 19.0.0 (#365).

v3.1.2

Choose a tag to compare

@inureyes inureyes released this 10 Nov 00:58

New Features

None

Improvements

  • Warned at server configuration load time, once per user and without logging the hash, when a user's password_hash uses a format the verifier rejects, such as SHA-crypt ($5$, $6$) or /etc/shadow placeholders (*, !, empty). Loading continues and those users still cannot log in (#354, #355).
  • Documented that server password hashes must be Argon2id (bssh-server hash-password) or bcrypt ($2a$, $2b$, $2x$, $2y$) in the UserDefinition::password_hash rustdoc and docs/architecture/server-configuration.md (#355, #357).

Bug Fixes

  • Fixed password authentication returning faster for users with an unusable stored hash (unsupported format, malformed Argon2 or malformed bcrypt) than for users with a real hash; these attempts now run the same dummy hash as unknown users. Login outcomes are unchanged (#356, #357).
  • Fixed Argon2 PHC strings without a salt or hash output (for example $argon2id$v=19$m=19456,t=2,p=1) being reported as a wrong password without hashing; they are now treated as malformed, warned at load time and take the dummy-hash path (#357).
  • Fixed the load-time warning flagging $2x$ bcrypt hashes, which log in successfully (#357).

CI/CD Improvements

None

Technical Details

  • Added a private is_supported_hash_format check in src/server/auth/password.rs, called by reload_users after inline overrides are applied (#355).
  • Added regression tests for the Alpine OpenSSH bypass attack shape over *, !, empty and $6$ hashes with password lengths from 0 to 1024, and a test-only call counter on PasswordVerifier that asserts exactly one dummy hash per unusable-hash or unknown-user attempt without wall-clock assertions (#355, #357).

Dependencies

None

Breaking Changes

None

Known Issues

  • Host keys presented during rekey were still not re-verified, pending upstream russh support (#336).
  • Multihop destination-constrained agent authentication remained blocked because russh cannot send publickey-hostbound-v00@openssh.com (#327).
  • cargo deny still reported RUSTSEC-2023-0071 (rsa) and RUSTSEC-2024-0449 (unsafe-libyaml via serde_yaml).

What's Changed

  • fix(server): warn on unsupported password hashes and fix hash docs by @inureyes in #355
  • fix(server): accept $2x$ in hash check and equalize unusable-hash timing by @inureyes in #357

Full Changelog: v3.1.1...v3.1.2

v3.1.1

Choose a tag to compare

@inureyes inureyes released this 05 Nov 10:25

New Features

None

Improvements

  • Sent session-bind@openssh.com on direct-authentication agent connections and, with forwarding enabled, on relayed forwarded-agent connections, so the direct phases of OpenSSH's agent-restrict test pass (#350).
  • Moved on to the next identity when an agent or local signer fails instead of aborting authentication, matching OpenSSH (#350).
  • Reworked initial host-key verification into two stages: trust and revocation are checked before key exchange completes without writing anything, then the negotiated key type is checked and trust is committed before authentication starts (#353).
  • Ran KnownHostsCommand once per connection and recorded known hosts through atomic updates that keep existing permissions and configured symlinks (#353).

Bug Fixes

  • Fixed cluster and --hosts commands containing spaces or shell syntax being parsed as SSH destinations and rejected by hostname validation (#351, #352).
  • Fixed external security-key provider errors losing the file and symbol detail after the libloading 0.9 upgrade (#349).
  • Fixed localhost integration tests that passed the SSH probe but failed transfers on a stale known_hosts entry, and stopped them from writing host keys into the user's known_hosts (#349).

CI/CD Improvements

None

Technical Details

  • Moved server public-key policy to SshHandler::authenticate_publickey because russh 0.65 Handler::auth_publickey takes a VerifiedPublicKey (#350).
  • Adapted password hashing to argon2 0.6 phc::PasswordHash and replaced deprecated AsyncFd::new with AsyncFd::register in the server PTY and process stdin (#349).
  • Deferred TOFU file writes, process pins and key-rotation permission to the commit stage and rechecked concurrent changes under the existing locks; mismatched algorithms, curves and certificate types stay fail-closed (#353).

Dependencies

  • Upgraded russh from 0.64.1 to 0.65.1, which includes the security fixes released in 0.65.0 and 0.65.1 (#350, #353).
  • Upgraded dirs 7, rustyline 19, lru 0.19, base64 0.23, libloading 0.9, argon2 0.6 and opentelemetry 0.33, and refreshed the remaining compatible dependencies (#349, #350, #353).
  • Kept ssh-key 0.7.0-rc.11, rsa 0.10.0-rc.18, pkcs1 0.8.0-rc.4 and generic-array 0.14.7 where russh and crypto-common pin them (#350, #353).

Breaking Changes

None

Known Issues

  • Host keys presented during rekey were still not re-verified, pending upstream russh support (#336).
  • Multihop destination-constrained agent authentication remained blocked because russh cannot send publickey-hostbound-v00@openssh.com (#327).
  • cargo deny still reported RUSTSEC-2023-0071 (rsa) and RUSTSEC-2024-0449 (unsafe-libyaml via serde_yaml).

v3.1.0

Choose a tag to compare

@inureyes inureyes released this 22 Oct 15:58

Changes since v3.0.1.

New Features

  • Added FIDO security-key authentication through OpenSSH sk-api libraries and a built-in USB HID provider on Linux and macOS, including CTAP 2.1 sensor verification (#333, #334, #346).
  • Added bssh-keygen enrollment for ed25519-sk and ecdsa-sk and resident credential download with -K (#347).
  • Added network-ping / nping for direct IPv4/IPv6 ICMP checks with per-host packet loss, latency statistics and aggregate exit status (#324).
  • Added validated host certificates with CA trust, principal, validity, signature-algorithm and revocation checks, including KnownHostsCommand CA sources (#329, #332).
  • Added Unix-domain socket forwarding and remote dynamic SOCKS forwarding with PermitRemoteOpen restrictions (#325, #329).

Improvements

  • Enabled macOS UseKeychain passphrase lookup and storage while preserving batch-mode and authentication timeout policy (#316).
  • Improved ProxyJump resolution, SSH percent-token expansion, control commands, background detachment and cancellation-safe SCP input (#325).
  • Removed unnecessary client connection delays that added about 0.6 seconds per connection (#329).

Bug Fixes

  • Fixed SFTP upload disconnects when requests arrived faster than storage by applying backpressure and bounding queued requests (#321).
  • Restricted substituted ProxyCommand endpoint values to prevent shell injection through host, user and alias data (#342).
  • Hardened Match exec and LocalCommand token handling and bounded SOCKS negotiation (#325).
  • Fixed host-certificate trust gaps, multi-file revocation handling and Unix-socket publication races (#332).
  • Enforced the negotiated host-key algorithm when accepting a server key or certificate (#333).
  • Rejected server security-key authorization policies whose touch or user-verification requirements cannot be enforced (#343).

CI/CD Improvements

  • Updated the declared MSRV and Debian/Launchpad build toolchain to Rust 1.97 (#341).
  • Serialized HOME-sensitive tests and added a repeatable race-test runner (#344).

Technical Details

  • Moved pipelined SFTP client transfers and server read-ahead into bssh using upstream public APIs (#320).
  • Raised measured OpenSSH regression results to 69/70 on Ubuntu and 66/67 on macOS in the security-key support validation; destination-constrained agent authentication remained incomplete (#333).

Dependencies

  • Replaced the internal SSH and SFTP forks with upstream russh 0.64.1 and russh-sftp 3.0.1 (#317, #318, #320).
  • Added HID transport, provider loading and cryptographic dependencies for FIDO signing and enrollment (#333, #334, #347).

Breaking Changes

  • Raised the minimum supported Rust version from 1.96 to 1.97 (#341).
  • Rejected substituted ProxyCommand values containing whitespace, shell syntax, non-ASCII characters, scoped IPv6 or a leading hyphen; ordinary aliases and normalized IPv6 remained supported (#342).
  • Replaced the warn-and-TOFU handling of @cert-authority with certificate validation and removed BSSH_CERT_AUTHORITY_POLICY (#329).
  • Required the first matching server authorized_keys entry for a security key to specify no-touch-required without verify-required until signature flags can be enforced (#343).

Known Issues

  • Destination-constrained agent authentication remained blocked on upstream session-binding support (#327).
  • WebAuthn security-key host signatures remained unsupported (#345).
  • Physical-authenticator validation remained pending on Linux and macOS (#334, #348).
  • Built-in resident enrollment required a PIN and credential management; write-attestation remained unsupported and serialized key handles were limited to 255 bytes (#347).
  • Native OpenSSH mux-v4 interoperability and some control-channel operations remained incomplete (#325, #329).

What's Changed

  • update(deps): replace the russh fork with upstream russh 0.64.1 by @inureyes in #317
  • update(deps): sync bssh-russh-sftp with upstream russh-sftp 3.0.1 by @inureyes in #318
  • refactor(sftp): drop the bssh-russh-sftp fork for upstream russh-sftp by @inureyes in #320
  • fix(sftp): throttle fast uploads instead of dropping the session by @inureyes in #321
  • fix(ssh): enable macOS UseKeychain runtime support by @inureyes in #316
  • feat: add direct ICMP network ping by @inureyes in #324
  • fix: advance OpenSSH client compatibility by @inureyes in #325
  • fix: close residual OpenSSH regress gaps in rekey, multiplex, and host certificates by @inureyes in #329
  • fix(ssh): close host-certificate and Unix-socket hardening gaps by @inureyes in #332
  • feat(ssh): support FIDO security keys through SecurityKeyProvider by @inureyes in #333
  • feat(ssh): add the built-in internal SecurityKeyProvider over USB HID by @inureyes in #334
  • build: bump Launchpad PPA toolchain and MSRV to Rust 1.97 by @inureyes in #341
  • fix(security): constrain ProxyCommand endpoint token expansion by @inureyes in #342
  • fix: Serialize HOME-sensitive unit tests by @inureyes in #344
  • fix: Reject security-key policies the server cannot enforce by @inureyes in #343
  • feat(ssh): add CTAP 2.1 UV token signing by @inureyes in #346
  • feat(keygen): enroll and download FIDO security keys by @inureyes in #347
  • docs: update security-key compatibility ledger by @inureyes in #348

Full Changelog: v3.0.1...v3.1.0

v3.0.1

Choose a tag to compare

@inureyes inureyes released this 01 Sep 11:09

New Features

None.

Improvements

  • Replaced developer-only tracking and historical-version references in active CLI help, runtime warnings, manpages, README, current release notes, and public Rust documentation with behavior-focused guidance.
  • Reframed exit-code and compression guidance around current behavior and operator actions.

Bug Fixes

None.

CI/CD Improvements

None.

Technical Details

  • Added rendered-help regression checks for bssh, bssh-server, and bssh-keygen so internal issue and pull request references cannot reappear.
  • Kept archived pre-3.0 changelog entries and private implementation comments for historical traceability.

Dependencies

None.

Breaking Changes

None.

Known Issues

  • OpenSSH compatibility remains incomplete for restricted-agent forwarding, agent-backed host certificates, some dynamic-forwarding forms, multiplexing interoperability, percent-token expansion, and ProxyJump edge cases.
  • Ubuntu validation has unresolved rekey and legacy remote-to-remote scp -3 coverage. The reference OpenSSH client fails the corresponding macOS fixtures.
  • Forty recognized SSH configuration keywords remain unimplemented. Each ignored keyword emits one warning that names its configuration source.
  • Connection multiplexing uses a private bssh protocol rather than OpenSSH mux v4. -O conninfo and some OpenSSH control operations are not supported.

What's Changed

  • docs: make user-facing guidance self-contained by @inureyes in #315

Full Changelog: v3.0.0...v3.0.1

v3.0.0

Choose a tag to compare

@inureyes inureyes released this 01 Sep 05:56

Highlights

  • Added -E diagnostic logging and -G effective SSH configuration output.
  • Added runtime support for SSH algorithm selection, environment requests, local and remote commands, TTY and subsystem policy, null stdin, and -W standard-input/output forwarding.
  • Added bssh connection multiplexing with -M, control commands, ControlPath, ControlPersist, forwarding changes, and background masters.
  • Added session-scoped SSH agent forwarding and server authentication banners.

Security and reliability

  • Honor configured user and global known-hosts stores, HostKeyAlias, revoked keys, malformed files, and multi-file matching across direct, interactive, forwarding, and jump-host connections.
  • Enforce CheckHostIP, HashKnownHosts, KnownHostsCommand, DNSSEC-aware SSHFP verification, and proof-backed UpdateHostKeys rotation.
  • Enforce identity selection, user certificates, accepted algorithms, authentication ordering, batch mode, and password prompt limits.
  • Escape control characters in SSH configuration diagnostics.
  • Preserve exact stdout and stderr bytes for one SSH destination without banners, prefixes, ANSI styling, synthesized newlines, forwarding status, or summaries.
  • Execute ProxyCommand through managed child transports with bounded diagnostics and deterministic cleanup.
  • Report stage-specific DNS, TCP, negotiation, host-key, authentication, channel, command, and timeout failures with SSH-compatible exit status 255.
  • Apply local, remote, and dynamic forwarding directives, source binding, IPQoS, and byte- or time-based RekeyLimit policies at runtime.

Breaking changes

Native bssh 2.x scripts using the following short flags must migrate before running with 3.0.

Short flag bssh 2.x meaning bssh 3.0 meaning Replacement for the 2.x meaning
-N Remove output prefixes Do not execute a remote command --no-prefix
-f Filter hosts Go to the background after authentication --filter
-C Select a cluster Enable compression --cluster
-A Use the local agent for authentication Forward the local agent to the remote host --use-agent
-S Read a sudo password Select the multiplexing control path --sudo-password
-k Stop after the first failure Disable GSSAPI credential delegation --fail-fast
-b Enable batch execution Bind the client to a source address --batch
  • -A now expands the remote host's access to the local agent. Change scripts that intended local agent authentication to --use-agent.
  • One-destination execution now uses the SSH-compatible raw output path. Use -H host to retain bssh's multi-host banner, prefixes, progress UI, forwarding status, and summary for one host.
  • -V now writes the version to stderr instead of stdout.
  • pdsh short-option meanings remain available only with --pdsh-compat or when bssh is invoked as pdsh.

Known limitations

  • OpenSSH compatibility remains incomplete for restricted-agent forwarding, agent-backed host certificates, some dynamic-forwarding forms, multiplexing interoperability, percent-token expansion, and ProxyJump edge cases.
  • Ubuntu validation also has unresolved rekey and legacy remote-to-remote scp -3 coverage; the reference OpenSSH client fails the corresponding macOS fixtures.
  • Forty recognized SSH configuration keywords remain unimplemented. Each ignored keyword emits one warning that names its configuration source.
  • Connection multiplexing uses a private bssh protocol rather than OpenSSH mux v4. -O conninfo and some OpenSSH control operations are not supported.

Full changelog: v2.4.3...v3.0.0

v2.4.3

Choose a tag to compare

@inureyes inureyes released this 24 Aug 08:22

New Features

None

Improvements

  • SFTP pipelined reads now preserve partial data and request only the missing bytes when a server returns a legal short non-empty DATA reply (#273).
  • The internal bssh-russh-sftp fork now tracks upstream 2.4.0 and records both local performance patches so future syncs cannot silently delete them (#272).

Bug Fixes

  • Fixed bssh-to-bssh SFTP downloads above 255 KiB by advertising server limits through limits@openssh.com, respecting those limits in the client, and rejecting empty data before a known EOF (#273).

CI/CD Improvements

  • Skipped Rust CI and MSRV jobs when every changed path is documentation, licensing text, a composite action, or a listed release workflow (#267).
  • Fixed the Homebrew formula update job so it runs after successful release builds for pre-release promotion, direct official releases, and opted-in manual dispatches (#268).
  • Replaced Apple ID notarization credentials with an organization-managed App Store Connect API key (#269).
  • Promoted manually dispatched releases after artifact upload and made unreadable release state a hard failure (#269).

Technical Details

  • Verifying host-key modes now reject unexpected OpenSSH host certificates because bssh does not validate certificate-authority signatures; explicit no-check mode remains unchanged (#270).
  • Negotiated SFTP read and write limits are clamped to packet payload and protocol-length ceilings before allocation or request construction (#273).

Dependencies

  • Upgraded russh from 0.62.1 (previously locked at 0.62.7) to 0.63.1, including fixes for callbacks on never-opened channel IDs (GHSA-47hw-gvq5-r2gm) and a cipher/MAC negotiation panic (GHSA-p8qx-h547-fjw9) (#270).
  • Upgraded mockall from 0.14.0 to 0.15.0 and serial_test from 3.5.0 to 4.0.1; runtime dependencies and application code are unchanged (#274).

Breaking Changes

None

Known Issues

None

What's Changed

  • chore: skip CI Rust build on non-Rust-only changes by @inureyes in #267
  • fix: run the Homebrew formula job automatically on release by @inureyes in #268
  • update: upgrade russh to 0.63.1 and refuse host certificates by @inureyes in #270
  • update: sync bssh-russh-sftp with upstream russh-sftp 2.4.0 by @inureyes in #272
  • feat(release): notarize with an API key, and promote on dispatch by @inureyes in #269
  • fix: negotiate SFTP read limits by @inureyes in #273
  • update: upgrade test dependencies by @inureyes in #274

Full Changelog: v2.4.2...v2.4.3

v2.4.2

Choose a tag to compare

@inureyes inureyes released this 14 Aug 10:07

Republishes the macOS binaries with a working code signature. No source changed between 2.4.1 and 2.4.2, so the Linux binaries behave identically and only macOS users need this release.

macOS users on 2.4.1 or earlier should upgrade. Those builds no longer run: macOS terminates them on launch and deletes the file. Reinstall with brew update && brew upgrade bssh.

New Features

None

Improvements

None

Bug Fixes

  • Sign the macOS binaries with a Developer ID Application certificate and notarize them (#264). Every macOS release through 2.4.1 was signed with an Apple Distribution certificate, an App Store submission identity whose leaf carries the App Store extension (1.2.840.113635.100.6.1.7) but not the Developer ID extension (1.2.840.113635.100.6.1.13) that Gatekeeper requires outside the App Store, and none was ever submitted to notarytool. codesign --sign "Distribution" matches identity names by substring, so it picked that certificate out of the keychain. Downloads were refused with a security warning for eight months; when the certificate was revoked on 2026-08-12, the failure escalated from a warning to CSSMERR_TP_CERT_REVOKED, and macOS began killing installed binaries on launch and deleting them as malware, which broke every Homebrew installation. All three released binaries (bssh, bssh-server, bssh-keygen) are now signed with a Developer ID Application certificate under the hardened runtime and notarized.

CI/CD Improvements

  • Fail the release when the signing certificate is the wrong type (#264). Nothing in the release workflow inspected the resulting signature, which is why the wrong certificate shipped unnoticed for eight months. Signing now runs through two composite actions under .github/actions/: the setup action rejects a p12 that holds no Developer ID Application certificate before anything is signed, and the signing action asserts the Developer ID Application authority, the hardened runtime flag, and the pinned code signature identifier after signing, then gates on notarization reaching status: Accepted.
  • Replace Apple's codesign with rcodesign for release signing (#264). rcodesign reads the signing certificate from a PEM directly, so the identity comes from the supplied certificate rather than from a substring match against whatever happens to be in the runner keychain, and no keychain or GUI session is needed.

Technical Details

  • A bare Mach-O executable cannot be stapled, so stapler staple is not attempted. The notarization ticket stays on Apple's servers and Gatekeeper resolves it online on first launch.
  • Each of the three binaries is signed under its own pinned code signature identifier: com.lablup.bssh, com.lablup.bssh-server, and com.lablup.bssh-keygen. Pinning the identifier keeps it stable regardless of the file name the binary is installed under.
  • The zip layout is unchanged (the binary plus its man page at the top level), so the Homebrew formula needed no changes.
  • The member crate bssh-russh-sftp stays on its own version line at 2.3.0 and was not bumped.

Dependencies

None. No Cargo.toml requirement changed, and no crate entered or left the graph. Cargo.lock records only the bssh version bump itself.

Breaking Changes

None

Known Issues

  • A revoked certificate cannot be un-revoked, so the 2.4.1 and earlier macOS assets remain unusable and are not being re-signed in place. Upgrade rather than re-downloading an older tag.
  • Gatekeeper resolves the notarization ticket online for bare executables, so the first launch on a machine with no network access may be slower or fall back to a prompt.

v2.4.1

Choose a tag to compare

@inureyes inureyes released this 03 Aug 13:21

A patch release that closes the four items listed as known issues in the v2.4.0 release notes.

New Features

None. BSSH_CERT_AUTHORITY_POLICY=reject is new but is an opt-in hardening switch for existing behavior; see Improvements.

Improvements

  • accept-new keeps a process-lifetime host key pin when no known_hosts path can be determined, instead of disabling verification entirely (#242). Previously, in containers and service environments where HOME is unset and no passwd entry supplies a home directory, the CLI default mode accepted any server key unconditionally. The first key seen for a host:port is now pinned for the life of the process and a different key later in the same run is rejected. Nothing persists past the process, so this is still weaker than file-backed TOFU.
  • The known_hosts path is validated before it is treated as trust state (#242). A path that is a non-regular file, cannot be opened, or is a symlink that cannot be resolved now fails the connection and names which of the three it was, in both accept-new and strict mode. Previously all three were indistinguishable from an absent file, so accept-new treated every host as a first use and strict mode treated every host as unknown. A genuinely absent file still behaves as an empty one.
  • First-use recording is serialized across bssh processes, not just within one (#242). A sibling advisory lock file (known_hosts.lock, created 0600 under a 0700 parent) now wraps the check-then-record window, and the path probe, marker scan, and lookup all run again under the lock. Two bssh processes connecting to the same new host at once previously could both read known_hosts before either wrote and both append an entry.
  • BSSH_CERT_AUTHORITY_POLICY=reject makes a matching known_hosts @cert-authority line a hard rejection (#242). The default is unchanged: a match warns and falls through to ordinary TOFU, because bssh has no CA signature validation and failing closed would break every working CA setup with no workaround.

Bug Fixes

  • Forwarding target hostnames are sent to the server instead of being resolved on the client (#257). -L targets, SOCKS5 -D domain requests, later jump-chain hops, and the destination behind a jump chain now go out in the direct-tcpip request as written, and the remote sshd resolves them, matching OpenSSH. Any target whose name resolves only from the server's network position previously failed before a single byte of SSH traffic was sent, which is one of the primary reasons to use a bastion. Forcing -4 or -6 still resolves locally and sends a numeric address, since that is the only way the family request can affect a connection the server makes.
  • SOCKS4 dynamic forwarding honors the address family preference (#255). The SOCKS4 handler called a family-agnostic opener that hardcoded AddressFamily::Any, so it ignored -4, -6, and the ssh_config AddressFamily keyword while every other path in v2.4.0 honored them: bssh -6 -D 1080 user@host hard-failed every other path when IPv6 was unavailable and still handed back a proxy that tunneled IPv4. A SOCKS4 request under forced IPv6 is now refused with the protocol's 0x5B reply before an SSH channel is opened. Any and forced IPv4 are unchanged.
  • SOCKS5 parses IPv6 destination literals (#256). The ATYP 0x04 arm read none of the request body and replied 0x08 "address type not supported", so every SOCKS5 client sending an IPv6 destination was refused and bssh -6 -D 1080 was self-contradictory. The arm now consumes its 16 address bytes and 2 port bytes and forwards a bracketed [ipv6]:port target.
  • A socket address slice reports its first address as the hostname instead of a comma-joined list of every address (#243). A comma is the known_hosts host-list separator, so the joined form is rejected by the hostname validation added in v2.4.0.
  • A known_hosts file created by the first recording no longer starts with a blank line (#243). Cosmetic; it was never a parse problem. Files that already existed are untouched.

CI/CD Improvements

None.

Technical Details

  • Performance: the known_hosts write locks are skipped when the offered key already matches a recorded entry (#243). The marker scan and lookup run first without either lock and return on a definite match, so parallel connections to an already-recorded cluster no longer serialize on a lock they do not need. Both locks are still taken for a host that looks unknown, with the full check repeated under them so the fast path cannot race a concurrent first-time recording.
  • Tests: the nondeterministic test_expand_path_with_tilde failure under the full library suite is fixed (#243). Seven tests repoint the process-global HOME, and cargo runs tests in parallel threads, so HOME could change between expand_path's internal dirs::home_dir() call and the assertion's own call. EnvGuard now takes a dedicated HOME mutex when it sets or removes that variable, and EnvGuard::lock_home() gives read-only tests the same lock. No library behavior changed.
  • Validation: cargo fmt --all --check, cargo clippy --lib --tests --all-targets -- -D warnings, cargo test --lib (1386 passed, 0 failed, 9 ignored), and the focused address_family_test and socks_ipv6_literal_test suites all pass on the tagged commit.

Dependencies

No Cargo.toml requirement changed, and no crate entered or left the graph. Seven resolved versions moved in Cargo.lock: aho-corasick 1.1.4 to 1.1.5, darling, darling_core, and darling_macro 0.23.0 to 0.24.0, data-encoding 2.11.0 to 2.11.1, instability 0.3.12 to 0.3.13, and line-clipping 0.3.7 to 0.3.8.

Breaking Changes

None. The library API changed additively only. ServerCheckMethod gained AcceptNewKnownHostsFile(String) and AcceptNewInMemory in both the bssh::ssh::tokio_client enum and its bssh::shared::auth_types mirror, with From conversions in both directions; both enums are #[non_exhaustive], so an exhaustive downstream match already required a wildcard arm. ToSocketAddrsWithHostname gained a host_port method with a default body, so external implementors compile unchanged.

Note one user-visible behavior change that is a fix rather than a break: with no forced address family, forwarding targets are now resolved by the remote server rather than the client (#257). A deployment that relied on client-side resolution of a forwarding target name can force -4 or -6 to restore local resolution.

Known Issues

  • @cert-authority lines still fall through to ordinary TOFU by default. bssh has no CA signature validation, so the strict behavior is opt-in through BSSH_CERT_AUTHORITY_POLICY=reject rather than the default.
  • With no determinable known_hosts path, accept-new pins keys in memory only. The pin does not survive the process, so a first connection in a new process is still an unverified first use.
  • The cross-process known_hosts lock is advisory and cooperative. It serializes bssh against other bssh processes, not against an unrelated writer editing known_hosts directly.
  • SOCKS4 destinations remain IPv4-only by protocol definition. Under forced IPv6 they are now refused rather than silently tunneled, which is the intended behavior but means SOCKS4 and -6 cannot be combined.
  • tests/integration_test.rs has a localhost-auth fixture mismatch: its precheck lets system ssh use an agent while ParallelExecutor::new disables agent auth and supplies only ~/.ssh/id_rsa, so three localhost cases fail locally in agent-only environments. CI's --skip integration_test does not exclude the test binary.

What's Changed

  • fix: close host key fail-open paths by @inureyes in #259
  • chore: resolve host key verification follow-ups by @inureyes in #260
  • fix: preserve forwarded target hostnames by default by @inureyes in #258
  • fix: repair merged host-port integration by @inureyes in #262
  • fix: honor address family for SOCKS4 forwarding by @inureyes in #263
  • fix: support SOCKS5 IPv6 literal destinations by @inureyes in #261

Full Changelog: v2.4.0...v2.4.1

v2.4.0

Choose a tag to compare

@inureyes inureyes released this 03 Aug 09:48

Host key verification in the default accept-new mode now actually verifies. Address family selection (-4/-6, ssh_config AddressFamily) works across every connection path. bssh ping reports a real exit code.

New Features

  • Address family selection works end to end. -4/-6 and the ssh_config AddressFamily keyword now govern direct connections for exec, interactive sessions, ping, and SFTP upload/download, plus port forwarding listeners and targets and every hop of a -J chain (#246, #248). Precedence follows OpenSSH: command line flag, then config keyword, then the any default.
  • Bracketed IPv6 address literals are accepted in host specifications: [::1], [::1]:22, user@[::1], and user@[::1]:22, in -H, SSH-style destinations, and both simple and detailed cluster node entries (#251).
  • bssh ping follows a 0/1/255 exit code contract, so health checks can branch on it (#245). 0 means every targeted host connected and authenticated, 1 means at least one succeeded and at least one failed, and 255 means no host succeeded or bssh failed before attempting a connection.

Improvements

  • ssh_config connection settings resolve against the actual target host instead of once per dispatch, so a per-host Host block applies to exec, ping, upload, and download rather than only to SSH mode (#249). This covers AddressFamily, Compression, ServerAliveInterval, and ServerAliveCountMax. A jump hop now resolves against its own Host bastion block instead of inheriting the destination's settings.
  • Interactive connection failures print the full anyhow context chain, so a jump-host failure names the hop that failed instead of collapsing to a single outer message (#238).
  • Forcing an address family that has no resolved address fails with no IPv6 address found for <host> (or the IPv4 equivalent) instead of the generic could not resolve to any addresses (#246).
  • The man page describes only current behavior. Two NOTES subsections that were release history moved to or were already covered by the changelog.

Bug Fixes

  • bssh ping always exited 0 while its help text promised otherwise, so every script branching on it passed unconditionally (#245).
  • -4/-6 and ssh_config AddressFamily were advertised in --help and the man page, parsed, and then discarded, so bssh -6 against a dual-stack host could still connect over IPv4 (#246).
  • Jump hops past the first tunneled over the wrong family. Those hops resolve their target locally and send a literal IP in the direct-tcpip request, so a -6 invocation could reach IPv4 for every hop after the first (#248).
  • ssh_config lookups outside SSH mode queried the literal "*" and missed per-host blocks, so bssh -H v6node uptime ignored a Host v6node stanza (#249).
  • Bracketed IPv6 literals died in the hostlist expander before any connection was attempted, because [ and ] are its range expression delimiters (#251). A bare ::1 reached the connect path and failed resolution instead.
  • The intermediate jump-hop error interpolated the jump host twice, printing Failed to connect to jump host bastion (hop 2): bastion.
  • The direct-connect and file-transfer paths built their anyhow chain backwards, so the raw SSH error rendered above the friendly message as a near-duplicate.
  • A context message that restated its own cause printed the same text twice on one line, such as Password authentication failed.: Password authentication failed.
  • Fixed the occured misspelling and the Ssh capitalization in the SshError and SftpError messages.

CI/CD Improvements

None

Technical Details

Four defects in accept-new and strict host key verification are fixed (#239):

  • accept-new, the documented default, mapped to NoCheck. Any server key was accepted unconditionally, nothing was written to known_hosts, and changed keys were never rejected. It now checks the offered key, records unknown hosts with an OpenSSH-style "Permanently added" notice, and rejects changed keys with the standard warning banner including the SHA256 fingerprint, offending file and line, and a remediation hint. Strict (yes) mode no longer downgrades to NoCheck when the known_hosts file is missing.
  • A host with two or more keys of one algorithm was rejected as changed as soon as one entry differed, a false man-in-the-middle alarm whose own remediation would have deleted the legitimate pin. Lookup now applies OpenSSH's rule: any recorded key equal to the offered key verifies.
  • Hostnames were recorded verbatim with no escaping, so a name containing a newline, space, #, or comma could pin a key against an unintended host, make a host permanently unconnectable, or hide the entry from later lookups. Names that cannot round-trip are now rejected before anything is looked up or written.
  • @revoked and @cert-authority marker lines were silently ignored, so an explicitly revoked key was recorded and accepted like any first use. A dedicated scan now runs first: a matching @revoked line is a hard rejection, and a @cert-authority match warns. Hostname matching is case-insensitive, and ~/.ssh and known_hosts are created with mode 0700/0600 directly rather than under the process umask.

SshConnectionConfigResolver is the new seam for per-target settings, combining command line overrides, YAML defaults, and ssh_config Host blocks. It runs at the ParallelExecutor per-node boundary and is threaded through SshClient and JumpHostChain.

The address family filter for tunneled targets reuses open_direct_tcpip_channel_with_family, the same mechanism already used for -L forwarding targets.

Dependencies

No Cargo.toml requirement changed. Locked versions moved: russh 0.62.1 to 0.62.5, tokio 1.52.3 to 1.53.1, clap 4.6.1 to 4.6.5, serde 1.0.228 to 1.0.229, and ratatui 0.30.0 to 0.30.2. The transitive set shifted with them, adding ratatui-termina, termina, palette, sponge-cursor, and approx and dropping scc, sdd, prettyplease, and the wit-bindgen / wasm-encoder / wasmparser toolchain crates.

Breaking Changes

Behavior:

  • bssh ping against hosts that are all unreachable now exits 255. It previously exited 0, which is also not the 1 the old help text implied.
  • accept-new now performs real verification. A changed host key is rejected where it was previously accepted, and connections that silently succeeded against a rotated or substituted key will now fail until the entry is reconciled.
  • With -6, a -L or -D specification that does not name a bind address listens on ::1 instead of 127.0.0.1, and the *:port wildcard form listens on :: instead of 0.0.0.0. Scripts that pass -6 and assume an IPv4 loopback listener should name the bind address explicitly, for example -L 127.0.0.1:8080:example.com:80.
  • An unbracketed IPv6 literal is rejected with IPv6 address literals must be enclosed in brackets, for example '[::1]' instead of failing during resolution.

Library API, for consumers of the bssh crate:

  • bssh::commands::ping::ping_nodes returns Result<PingOutcome> instead of Result<()> (#245). Callers that ignored the old Ok(()) keep compiling; callers that matched on it exhaustively update the pattern.
  • The four SshClient::*_with_jump_hosts helpers take a &SshConnectionConfig and an Option<&SshConnectionConfigResolver> in place of their former trailing argument (#246, #249).
  • ForwardingSpec::parse_local, parse_dynamic, and parse take an AddressFamily argument (#246).
  • ForwardingConfig gained a public address_family field, bssh::ssh::tokio_client::Error gained a NoAddressForFamily variant, and bssh::ssh::tokio_client exports the new SshConnectionConfigResolver (#246, #249).

Known Issues

  • @cert-authority lines warn but do not gate the connection. bssh has no CA signature validation, so a match falls through to ordinary TOFU rather than failing closed, which would break every working CA setup with no workaround.
  • When no home directory can be determined, accept-new falls back to no verification after printing a warning to stderr, since there is no persistent trust state to record against.
  • The known_hosts first-write lock is process-wide. Two concurrent bssh processes recording the same new host are not serialized against each other.
  • SOCKS4 requests carry a literal IPv4 destination by protocol definition and are passed through unfiltered by the address family preference. Forwarding target filtering for -L and SOCKS5 is a best-effort hint, since the remote server performs the actual connect.

What's Changed

  • fix: show full anyhow error chain on interactive connect failure by @inureyes in #240
  • fix(security): implement real TOFU for accept-new host key mode by @inureyes in #241
  • fix: wire up the -4/-6 address family flags and AddressFamily by @inureyes in #247
  • fix: report a real exit code from bssh ping by @inureyes in #250
  • feat: filter tunneled jump targets by address family by @inureyes in #252
  • fix: resolve ssh config per connection target by @inureyes in #254
  • fix: accept bracketed IPv6 host literals (#251) by @inureyes in #253

Full Changelog: v2.3.1...v2.4.0