Skip to content

mac: harden terminal bridge callbacks and output links - #183

Merged
khoi merged 6 commits into
mainfrom
fix/ghostty-security
Aug 8, 2026
Merged

mac: harden terminal bridge callbacks and output links#183
khoi merged 6 commits into
mainfrom
fix/ghostty-security

Conversation

@khoi

@khoi khoi commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Why

The updated terminal core exposed four host gaps: OSC 8 output links reached the unrestricted system opener, immediate clipboard denials could invalidate embedded callback state, off-main close delivery could outlive its bridge, and several performed actions returned false. The bridge also retained write-only state for actions Supaterm did not perform.

What changed

  • Defer immediate clipboard denials and retain close callbacks through main-actor delivery
  • Apply allow, confirm, and deny rules to OSC 8 links and sanitize hover text
  • Return real action results, including undo and redo responder results
  • Keep parsed URL actions handled after dispatch
  • Remove inert bridge state and report actions with no effect as unhandled
  • Isolate cached surface values to the main actor

This uses the terminal fork baseline merged in #187.

Verification

  • make mac-check passed
  • Runtime, bridge, clipboard, URL-policy, and surface-view suites passed
  • Hosted Mac, end-to-end, and UI checks passed on the prior equivalent head
  • Dead-code scan passed

Per-surface color handling remains in the next stacked PR.

@khoi khoi added the bug Something isn't working label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

SupaReview

Review failed.

View action run

@tuist

tuist Bot commented Aug 8, 2026

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Cache hit rate Tests Skipped Ran Commit
supatermUITests 0 % 76 0 76 12eb97744

Builds 🔨

Scheme Status Duration Commit
supatermUITests 1m 20s 12eb97744

khoi added 6 commits August 8, 2026 21:29
The bridge reported completed actions as unhandled and could release a
surface bridge before queued close delivery reached the main thread.

Return each direct result, keep the bridge alive across that queue hop,
and remove state that no caller reads.
Clipboard denial could release native request state from inside its own
callback, while cached terminal text could expire during a concurrent
read. Defer denials until the next main turn and lock cache access.
OSC 8 links come from terminal output and must not enter Launch Services
through the generic opener. Allow known schemes, confirm custom handlers,
block deceptive or executable targets, and show the effective destination.
@khoi
khoi force-pushed the fix/ghostty-security branch from d5f4b79 to 1fe3e2d Compare August 8, 2026 20:34
@khoi
khoi merged commit 8ae57b8 into main Aug 8, 2026
19 checks passed
@khoi
khoi deleted the fix/ghostty-security branch August 8, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant