Repository navigation
Releases
v3.1.3
New Features
None
Improvements
- Replaced the deprecated
serde_yamlwithserde-saphyr2.1.1, a YAML parser written in safe Rust, which removedunsafe-libyaml(RUSTSEC-2024-0449) from the dependency tree (#358). - Replaced the unmaintained
chronowithjifffor audit log timestamps, TUI and interactive clock display, and output file names. Audit JSON timestamps are byte-identical to before (RFC 3339 UTC with aZsuffix 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
notarytoolrejected the stored secret withinvalidPEMDocument. Failures now report the key's shape without printing key material (#360).
Technical Details
- Added a serde helper in
src/server/audit/timestamp.rsthat writes audit timestamps with chrono's shortest exact fractional width, and documented the format indocs/audit-logging.md(#364). - The OpenTelemetry exporter converts timestamps with
SystemTime::try_fromand 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_yaml0.9 withserde-saphyr2.1.1 (#358). - Replaced
chrono0.4 withjiff1.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_yamlignored them. Some inputsserde_yamlrejected now load, including YAML 1.1 booleans such asyes, 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 denystill reported RUSTSEC-2026-0543 (chrono) throughrussh-sftp3.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
New Features
None
Improvements
- Warned at server configuration load time, once per user and without logging the hash, when a user's
password_hashuses a format the verifier rejects, such as SHA-crypt ($5$,$6$) or/etc/shadowplaceholders (*,!, 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 theUserDefinition::password_hashrustdoc anddocs/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_formatcheck insrc/server/auth/password.rs, called byreload_usersafter 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 onPasswordVerifierthat 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 denystill 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
New Features
None
Improvements
- Sent
session-bind@openssh.comon direct-authentication agent connections and, with forwarding enabled, on relayed forwarded-agent connections, so the direct phases of OpenSSH'sagent-restricttest 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
KnownHostsCommandonce per connection and recorded known hosts through atomic updates that keep existing permissions and configured symlinks (#353).
Bug Fixes
- Fixed cluster and
--hostscommands 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_hostsentry, and stopped them from writing host keys into the user'sknown_hosts(#349).
CI/CD Improvements
None
Technical Details
- Moved server public-key policy to
SshHandler::authenticate_publickeybecause russh 0.65Handler::auth_publickeytakes aVerifiedPublicKey(#350). - Adapted password hashing to argon2 0.6
phc::PasswordHashand replaced deprecatedAsyncFd::newwithAsyncFd::registerin 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
russhfrom 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-key0.7.0-rc.11,rsa0.10.0-rc.18,pkcs10.8.0-rc.4 andgeneric-array0.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 denystill reported RUSTSEC-2023-0071 (rsa) and RUSTSEC-2024-0449 (unsafe-libyaml via serde_yaml).
v3.1.0
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-keygenenrollment fored25519-skandecdsa-skand resident credential download with-K(#347). - Added
network-ping/npingfor 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
KnownHostsCommandCA sources (#329, #332). - Added Unix-domain socket forwarding and remote dynamic SOCKS forwarding with
PermitRemoteOpenrestrictions (#325, #329).
Improvements
- Enabled macOS
UseKeychainpassphrase 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
ProxyCommandendpoint values to prevent shell injection through host, user and alias data (#342). - Hardened
Match execandLocalCommandtoken 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
russh0.64.1 andrussh-sftp3.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
ProxyCommandvalues 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-authoritywith certificate validation and removedBSSH_CERT_AUTHORITY_POLICY(#329). - Required the first matching server
authorized_keysentry for a security key to specifyno-touch-requiredwithoutverify-requireduntil 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-attestationremained 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
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, andbssh-keygenso 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 -3coverage. 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 conninfoand some OpenSSH control operations are not supported.
What's Changed
Full Changelog: v3.0.0...v3.0.1
v3.0.0
Highlights
- Added
-Ediagnostic logging and-Geffective SSH configuration output. - Added runtime support for SSH algorithm selection, environment requests, local and remote commands, TTY and subsystem policy, null stdin, and
-Wstandard-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-backedUpdateHostKeysrotation. - 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
ProxyCommandthrough 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
RekeyLimitpolicies 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 |
-Anow 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 hostto retain bssh's multi-host banner, prefixes, progress UI, forwarding status, and summary for one host. -Vnow writes the version to stderr instead of stdout.- pdsh short-option meanings remain available only with
--pdsh-compator when bssh is invoked aspdsh.
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 -3coverage; 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 conninfoand some OpenSSH control operations are not supported.
Full changelog: v2.4.3...v3.0.0
v2.4.3
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
DATAreply (#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
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 Distributioncertificate, 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 toCSSMERR_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 theDeveloper ID Applicationauthority, the hardened runtime flag, and the pinned code signature identifier after signing, then gates on notarization reachingstatus: Accepted. - Replace Apple's
codesignwith 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 stapleis 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, andcom.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-sftpstays 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
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-newkeeps 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 whereHOMEis unset and no passwd entry supplies a home directory, the CLI default mode accepted any server key unconditionally. The first key seen for ahost:portis 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-newand strict mode. Previously all three were indistinguishable from an absent file, soaccept-newtreated 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=rejectmakes a matching known_hosts@cert-authorityline 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).
-Ltargets, SOCKS5-Ddomain requests, later jump-chain hops, and the destination behind a jump chain now go out in thedirect-tcpiprequest 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-4or-6still 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_configAddressFamilykeyword while every other path in v2.4.0 honored them:bssh -6 -D 1080 user@hosthard-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.Anyand 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 1080was self-contradictory. The arm now consumes its 16 address bytes and 2 port bytes and forwards a bracketed[ipv6]:porttarget. - 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_tildefailure under the full library suite is fixed (#243). Seven tests repoint the process-globalHOME, and cargo runs tests in parallel threads, soHOMEcould change betweenexpand_path's internaldirs::home_dir()call and the assertion's own call.EnvGuardnow takes a dedicatedHOMEmutex when it sets or removes that variable, andEnvGuard::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 focusedaddress_family_testandsocks_ipv6_literal_testsuites 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-authoritylines still fall through to ordinary TOFU by default. bssh has no CA signature validation, so the strict behavior is opt-in throughBSSH_CERT_AUTHORITY_POLICY=rejectrather than the default.- With no determinable known_hosts path,
accept-newpins 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
-6cannot be combined. tests/integration_test.rshas a localhost-auth fixture mismatch: its precheck lets systemsshuse an agent whileParallelExecutor::newdisables agent auth and supplies only~/.ssh/id_rsa, so three localhost cases fail locally in agent-only environments. CI's--skip integration_testdoes 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
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/-6and the ssh_configAddressFamilykeyword now govern direct connections forexec, interactive sessions,ping, and SFTPupload/download, plus port forwarding listeners and targets and every hop of a-Jchain (#246, #248). Precedence follows OpenSSH: command line flag, then config keyword, then theanydefault. - Bracketed IPv6 address literals are accepted in host specifications:
[::1],[::1]:22,user@[::1], anduser@[::1]:22, in-H, SSH-style destinations, and both simple and detailed cluster node entries (#251). bssh pingfollows 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
Hostblock applies toexec,ping,upload, anddownloadrather than only to SSH mode (#249). This coversAddressFamily,Compression,ServerAliveInterval, andServerAliveCountMax. A jump hop now resolves against its ownHost bastionblock 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 genericcould 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 pingalways exited 0 while its help text promised otherwise, so every script branching on it passed unconditionally (#245).-4/-6and ssh_configAddressFamilywere advertised in--helpand the man page, parsed, and then discarded, sobssh -6against 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-tcpiprequest, so a-6invocation could reach IPv4 for every hop after the first (#248). - ssh_config lookups outside SSH mode queried the literal
"*"and missed per-host blocks, sobssh -H v6node uptimeignored aHost v6nodestanza (#249). - Bracketed IPv6 literals died in the hostlist expander before any connection was attempted, because
[and]are its range expression delimiters (#251). A bare::1reached 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
occuredmisspelling and theSshcapitalization in theSshErrorandSftpErrormessages.
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 toNoCheck. Any server key was accepted unconditionally, nothing was written toknown_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 toNoCheckwhen 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. @revokedand@cert-authoritymarker 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@revokedline is a hard rejection, and a@cert-authoritymatch warns. Hostname matching is case-insensitive, and~/.sshandknown_hostsare 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 pingagainst hosts that are all unreachable now exits 255. It previously exited 0, which is also not the 1 the old help text implied.accept-newnow 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-Lor-Dspecification that does not name a bind address listens on::1instead of127.0.0.1, and the*:portwildcard form listens on::instead of0.0.0.0. Scripts that pass-6and 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_nodesreturnsResult<PingOutcome>instead ofResult<()>(#245). Callers that ignored the oldOk(())keep compiling; callers that matched on it exhaustively update the pattern.- The four
SshClient::*_with_jump_hostshelpers take a&SshConnectionConfigand anOption<&SshConnectionConfigResolver>in place of their former trailing argument (#246, #249). ForwardingSpec::parse_local,parse_dynamic, andparsetake anAddressFamilyargument (#246).ForwardingConfiggained a publicaddress_familyfield,bssh::ssh::tokio_client::Errorgained aNoAddressForFamilyvariant, andbssh::ssh::tokio_clientexports the newSshConnectionConfigResolver(#246, #249).
Known Issues
@cert-authoritylines 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-newfalls back to no verification after printing a warning to stderr, since there is no persistent trust state to record against. - The
known_hostsfirst-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
-Land 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