Skip to content

gterm: fix SSH, LLM, and persistence defects from audit - #40

Merged
madeye merged 1 commit into
mainfrom
fix/audit-first-party-defects
Aug 27, 2026
Merged

madeye merged 1 commit into
mainfrom
fix/audit-first-party-defects

Conversation

@madeye

@madeye madeye commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

First-party audit of SSH/auth, Keychain/persistence, LLM completion/command sanitizer, and session lifecycle. Fixes correctness, security, and reliability defects found there:

  • Reject invalid LLM provider URLs instead of silently sending the API key to api.openai.com.
  • Keep completion suffixes (leading space), strip CRLF/quotes in sanitizers.
  • Skip unusable private keys instead of aborting the whole connect; PEM parse uses trimmed input.
  • Host-key fingerprints accept unpadded base64.
  • PTY close notifies once (error is not overwritten by a later clean close).
  • Session state updates re-check stopped on the main queue so a queued .connected cannot stick the UI after disconnect.
  • In-flight port-forward binds are closed if stopAll() wins the race.
  • Command history drops passwd / sshpass / secret assignments; SSH ports must be 1–65535.

Test plan

  • xcodegen generate && xcodebuild -project gterm.xcodeproj -scheme gtermTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 17' test — 82 tests, TEST SUCCEEDED
  • xcodebuild -project gterm.xcodeproj -scheme gterm -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO build — BUILD SUCCEEDED

Reject invalid LLM provider URLs instead of sending keys to OpenAI,
keep completion suffixes and command sanitizer output intact, skip
unusable SSH keys, and drop session/port-forward work that races
past stop. Filter obvious secrets from command history and reject
out-of-range SSH ports.
@madeye
madeye merged commit 9381e00 into main Aug 27, 2026
1 check passed
@madeye
madeye deleted the fix/audit-first-party-defects branch August 27, 2026 01:18
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.

1 participant