Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Bug]: Desktop SSH reconnects leave old bearer sessions valid for 30 days (terminal scope), so they pile up on the server #20288

ClosedYoshiofthewire(GitHub profile, opens in a new tab) opened this issue 0 comments

Versions: server 0.0.44 and 0.0.45 (Linux, launched by the desktop app over SSH); desktop clients on Linux and macOS.

What happens Each time the desktop app connects to a remote server over SSH, it pairs again and gets a new bearer session. The previous session is never revoked. They pile up:

  • Server A: 69 sessions after a few weeks, from 3 desktop machines. All but one were unlabelled, not connected, used once and never again.
  • Servers B and C, same clients: 61 and 52 sessions, about 50 of them stale on each.

Every leftover session looks like this:

  • subject: one-time-token, method: bearer-access-token
  • no client label, connected: false
  • scopes include orchestration and terminal
  • expires 30 days after issue

Each one matched an SSH login from a desktop client. They weren't from another tool or a stray script.

Why it matters A terminal-scoped token is effectively a shell on the server. When a client replaces its session, the old one serves no purpose, but it stays valid for 30 days. Any copy that leaks during that time (logs, debugging output, a backup of the client's state) still works. Each server should have about one live credential per desktop, not dozens.

Expected One of these:

  • When a desktop re-pairs, revoke that client's previous session. This needs a stable client identity or label on desktop sessions.
  • Or reuse the existing bearer token when it's still valid, instead of pairing again.
  • Or give unlabelled desktop sessions a short idle timeout.

Workaround we use A weekly cron job that runs t3 auth session list --json with the running server's binary, then calls t3 auth session revoke on unlabelled, unconnected one-time-token / bearer-access-token sessions idle for 48 h or more. The desktops simply re-pair afterwards.

Related

  • #18229: each connect attempt mints a new pairing token (the source of the churn)
  • #9884: 30-day bearer token lifetime
  1. juliusmarminge closed this

Sign in to join this conversation.