Skip to content

fix(connection): reject bad SSH forward ports before connect #1684

Closed

Description

@SebTardif

CreatePullRequest is forbidden for this account, so this is the write-up for the branch.

Compare: https://github.com/openclaw/openclaw-windows-node/compare/main...SebTardif:fix/f068-reject-bad-forward-ports?expand=1

Branch: SebTardif:fix/f068-reject-bad-forward-ports
Head: fe0c60aa5771a571dd1144abc206bd0e293da88c

Connection Status accepted a blank SSH forward port as 18789 or 18790, and it kept a value such as 70000. Connect could then start the tunnel. The connection page already rejected those values.

SshForwardPorts.TryParse rejects a blank, unparsed, or out-of-range remote or local port. Both Connection Status and the connection page use it, and a bad port returns before ConnectAsync.

./build.ps1 passed. Shared 4263 passed, 34 skipped, 4297 total. Tray 4004 passed.

The Connection Status window was not opened on this head, and ssh.exe was not started.

Ref F068.

Activity

  1. added
    P2
    clawsweeper:fix-shape-clear
    clawsweeper:queueable-fix
    clawsweeper:source-repro
    impact:ux-friction
    issue-rating: 🦞 diamond lobster
    no-stale
    on Oct 9, 2026
  2. clawsweeper commented on Oct 9, 2026

    @clawsweeper

    Codex review: this still needs some work.

    Summary
    Current main still has the validation defect, and an open maintainer-owned PR explicitly closes this issue.

    Reproducibility: Current source establishes the path: enable SSH with valid URL, user, and host, then leave either forward port blank or enter 70000; Connection Status proceeds into ConnectAsync without field validation. No live reproduction was run.

    Next step
    Review and land #1729 (fix(connection): reject invalid SSH forward ports before connecting), then let its closing reference resolve this issue.

    Review details

    Best possible solution:

    Apply consistent field-specific validation before the direct-connect transaction while preserving valid ports and existing service ownership.

    Do we have a high-confidence way to reproduce the issue?

    Current source establishes the path: enable SSH with valid URL, user, and host, then leave either forward port blank or enter 70000; Connection Status proceeds into ConnectAsync without field validation. No live reproduction was run.

    Is this the best way to solve the issue?

    The linked repair shares the existing Connection page validation contract and rejects invalid input before transaction entry; its tests and reported visible proof should be assessed in that PR.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The linked repair remains a draft PR and has not merged.

    Codex review notes: model internal, reasoning medium; reviewed against 8115ba1c71cc.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: A bounded input-validation defect affects an optional SSH workflow and has downstream range enforcement.
    • impact:ux-friction: Invalid fields silently become defaults or enter a connection transaction instead of receiving immediate correction.
    Evidence reviewed

    What I checked:

    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed October 14, 2026, 10:22 PM ET / October 15, 2026, 02:22 UTC.

  3. clawsweeper commented on Oct 9, 2026

    @clawsweeper

    🦞🔧
    ClawSweeper is automatically building a fix for this issue.

    The issue review finished and no active implementation pull request was found.

    Automatic implementation progress:

  4. added
    status: 🚢 actively landing
    on Oct 15, 2026
  5. shanselman commented on Oct 15, 2026

    @shanselman
    Collaborator
  6. shanselman commented on Oct 15, 2026

    @shanselman
    Collaborator

    Taking this into the maintainer landing queue at Scott's request. Thanks @SebTardif for the existing branch and validation. We will preserve your contribution, bring the narrow port-validation fix onto current main, and complete the invalid/boundary regression coverage and isolated Connection Status proof before landing. Coordinated with the other active Seb PR session; no competing implementation is needed. The stop request above is to avoid duplicating the previously queued automatic worker, not to reject the proposed fix.

  7. clawsweeper commented on Oct 15, 2026

    @clawsweeper

    Got it. ClawSweeper will leave this item for human review.

    I added clawsweeper:human-review and paused the automation trail until a maintainer asks again.

  8. added
    clawsweeper:human-review
    and removed
    clawsweeper:queueable-fix
    clawsweeper:fix-shape-clear
    no-stale
    on Oct 15, 2026
  9. added
    status: 🚢 actively landing
    and removed
    status: 🚢 actively landing
    on Oct 15, 2026
  10. added
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    on Oct 15, 2026
  11. removed
    status: 🚢 actively landing
    on Oct 15, 2026
  12. locked as resolved and limited conversation to collaborators on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:human-reviewclawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:ux-frictionissue-rating: 🦞 diamond lobster

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions