Repository navigation
fix(connection): reject invalid SSH forward ports before connecting - #1729
Conversation
Connection Status treated a blank forward port as 18789 or 18790 and kept a value such as 70000. Both the status window and the connection page now use one parser. A port that does not parse, or that is outside 1 through 65535, stops the connect before a tunnel is built. ./build.ps1 passed. Shared 4263 passed / 34 skipped / 4297. Tray 4004 passed. Signed-off-by: Sebastien Tardif <[email protected]> (cherry picked from commit fe0c60a)
Expand invalid and valid boundary coverage and exercise Connection Status in an isolated real app. Preserve the contributor's original implementation commit. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 36aba55c-8528-40c0-8d40-8c010048f37d
|
Final CI update for head 4bd2882: CI Gate passed. Core/CLI, tray/setup/integration, UI/functional/accessibility, setup/connect E2E, network recovery E2E, revocation recovery E2E, x64 publish smoke, both MSIX architectures, and the multi-architecture bundle all passed. No submitted review findings or inline review comments remain. This supersedes the earlier CI-pending notes in the description. Additional autoreview remains skipped at Scott's explicit direction, not reported as passed. Existing local validation, rubber-duck review, and isolated UI proof are retained. |
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
Closes #1684
What Problem This Solves
Fixes: Connection Status enters the connection workflow when SSH forward ports are blank, malformed, or outside 1 through 65535.
User Impact
User impact: invalid remote/local ports show a field-specific error without replacing the active connection or substituting defaults.
Why This Change Was Made
Preserves @SebTardif's implementation and authorship: original
fe0c60aa5771a571dd1144abc206bd0e293da88c, cherry-picked with-xas72ebc36f. Follow-up4bd28825adds boundary/invalid tests, isolated real-app proof, and documentation. UI validation stays in the UI and transaction ownership stays withGatewayDirectConnectService. ConnectionPage behavior and downstream SSH enforcement remain unchanged. Port 70000 did not previously launch ssh.exe; it entered the connection workflow before downstream rejection.Evidence
Base-failing/head-passing source regression; 25 focused tests; six real-app invalid-input cases with fresh visible errors and unchanged registry/original operator connection. Rubber-duck found no production defects; its stale-error test concern was fixed and the UI proof rerun.
Additional autoreview skipped at Scott's explicit direction on October 14, 2026: "you can also just skip it because I said so". The attempted CLI-based review path could not start because its executable was unavailable. Codex CLI is not a required repository prerequisite. No autoreview pass is claimed. Existing rubber-duck review, local validation and visible proof remain valid; CI is still required.
Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: Connection Status inline validation, passed in the isolated native ARM64 app.Validation
With
OPENCLAW_REPO_ROOTset to the worktree:.\build.ps1: PASS, all five projects and docs.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --verbosity quiet: PASS, 4311 passed / 36 skipped / 4347 total.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --verbosity quiet: PASS, 4033 passed, zero skips.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --filter FullyQualifiedName~SshForwardPortsTests --verbosity quiet: PASS, 25 tests including null, whitespace, nonnumeric, negative, zero, 65536, 70000, overflow, and valid 1/65535/default controls.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-build --no-restore --filter FullyQualifiedName~StatusWindowDirectConnect_RejectsForwardPortsBeforeConnect --verbosity quiet: expected FAIL (one failed) against a scratch source fixture containing the unchanged72ebc36f^status-window source selected withOPENCLAW_REPO_ROOT. PASS against head in the focused/full suite. This is source-contract proof, not a base-app launch.dotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-arm64 -p:Platform=ARM64 -p:DevBuild=false --no-restore --filter FullyQualifiedName~ConnectionStatus_RejectsInvalidForwardPortsWithoutChangingGateway --logger 'console;verbosity=detailed': PASS, one test covering six cases, zero skips.python "$HOME\.agents\skills\autoreview\scripts\autoreview" --mode branch --base origin/main --engine codex --max-priority P3: attempted CLI path did not run a reviewer (executable not found: codex); additional autoreview subsequently SKIPPED at Scott's explicit direction. Branch preparation succeeded (493909 prompt bytes); earlier local preparation exceeded context capacity, resolved by committed branch mode. This is not a passing review verdict or a requirement to install Codex CLI.Real Behavior Proof
4bd28825source, committed unchanged after proof; app implementation72ebc36f.OPENCLAW_RUN_GATEWAY_FIXTURE_UI=1,OPENCLAW_GATEWAY_FIXTURE_APPset to this worktree'ssrc\OpenClaw.Tray.WinUI\bin\Debug\net10.0-windows10.0.22621.0\win-arm64\OpenClaw.Tray.WinUI.exe, andOPENCLAW_GATEWAY_FIXTURE_SCREENSHOTS=1. Open Diagnostics > event timeline, enable SSH, set valid URL/user/host, and invoke direct Connect for blank, 70000, and abc in each port field.61585a34fa55482786369d239ae6d677; owned-window screenshots captured and inspected locally; copied live output below.ConnectAsync.Yes/No/N/A): No. GitHub accepted the screenshot upload but its returned attachment URL did not resolve (404); no broken image embedded. Copied live output is preserved here.Security Impact
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No) Yes for valid inputs; invalid status-window inputs intentionally fail inline.Yes/No) NoYes/No) NoReview Conversations
ClawSweeper acknowledged stop and added
clawsweeper:human-review; no duplicate implementation found. Nearby PRs #1556 (fix(connection): copied browser SSH forward uses the local port on both sides), #1658 (fix(ssh): a GatewayPorts yes setting publishes the tunnel on every interface), and #1514 (fix(connection): Open Dashboard can send the token before the SSH forward owns the port) were checked and left outside this scope.