Skip to content

fix(connection): refuse to connect when a profile expects an SSH tunnel - #556

Merged
EVWorth merged 1 commit into
mainfrom
fix/connection-ssh-not-implemented
Sep 7, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/connection-ssh-not-implemented

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Closes #273.

What was happening

The dialog collects an SSH host, port, username, password and private-key passphrase. The store keeps them, and the keyring holds the secrets. Nothing reads any of it.

There's no ssh2 or russh dependency anywhere in the tree, and connect builds its options from profile.host and profile.port alone. So a profile configured to tunnel through a bastion connected straight to the database host, while every part of the UI said otherwise.

Someone who believes their traffic is tunnelled may be reaching a database over the open internet. That's the security half of the label, and it's why this is worse than not offering the feature at all.

What changes

connect and test_connection both refuse such a profile and say what would have happened instead, naming the SSH host and the direct host:port so the mismatch is visible.

test_connection matters as much as connect here: a Test Connection reporting success by reaching the database directly is the strongest possible false assurance that the tunnel works.

An SSH config with a blank host isn't treated as a request to tunnel — the dialog can leave one behind after its fields are cleared.

The SSH tab now says the feature isn't implemented before any credentials are typed, and says what to do instead: open a tunnel yourself and point the profile at the forwarded local port.

Why refuse rather than remove the tab

Refusing is reversible, leaves stored configuration alone for whenever the tunnel is actually built, and keeps the decision open. Deleting a visible feature is a product call rather than a bug fix — say the word if you'd rather the tab went entirely.

Connecting anyway was the one answer that couldn't stay.

Tests

Three unit tests on the refusal (no SSH is allowed, a configured tunnel is refused with both hosts named, a blank host isn't a tunnel) and two on the dialog. The dialog pair fails against the previous version.

1786 unit + 303 browser, 61 Rust lib, 54 integration against live servers, clippy/tsc/dprint/eslint clean.

Also closed, already fixed

Four connection issues turned out to be done and never closed — the PRs referenced them as Refs #N rather than with closing keywords. Each now has a comment naming the commit and what changed:

🤖 Generated with Claude Code

Closes #273.

The dialog collects an SSH host, port, username, password and private-key
passphrase. The store keeps them, and the keyring holds the secrets. Nothing
reads any of it.

There is no ssh2 or russh dependency anywhere in the tree, and `connect`
builds its options from `profile.host` and `profile.port` alone. So a
profile configured to tunnel through a bastion connected straight to the
database host, while every part of the UI said otherwise. Someone who
believes their traffic is tunnelled may be reaching a database over the open
internet.

Both `connect` and `test_connection` now refuse such a profile and say what
would have happened instead, naming the SSH host and the direct host:port so
the mismatch is visible. `test_connection` matters as much as `connect`: a
Test Connection reporting success by reaching the database directly is the
strongest possible false assurance that the tunnel works.

An SSH config with a blank host is not treated as a request to tunnel — the
dialog can leave one behind after its fields are cleared.

The SSH tab now says the feature is not implemented, before any credentials
are typed, and says what to do instead: open a tunnel and point the profile
at the forwarded local port.

Refusing rather than removing the tab: it is reversible, it leaves stored
configuration alone for whenever the tunnel is built, and deleting a visible
feature is a product decision rather than a bug fix. Connecting anyway was
the one answer that could not stay.

Three unit tests on the refusal, two on the dialog; the dialog pair fails
against the previous version.

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit 45ffe63 into main Sep 7, 2026
10 checks passed
@EVWorth
EVWorth deleted the fix/connection-ssh-not-implemented branch September 7, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P0][security] SSH tunnel stored but never used; no ssh2 dependency; ARCHITECTURE §3.1 SSHTunnel unimplemented

1 participant