Repository navigation
Replies: 1 comment
|
On MFA support cost: people who lose their second factor tend to lose the backup codes too, so required MFA means account resets. Per-device approval doesn't have that problem: the approver is the host itself ( |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Two things about T3 Connect's trust model, both checked against v0.1.7.
1. Signing in opens every linked environment, with full scope.
An environment mints a session for any relay-signed request whose
subis the Clerk user that linked it (the mint handler inapps/server/src/cloud/CloudLink.ts). That session carriesAuthStandardClientScopes, which include terminal operate, filesystem write and access write. The relay only checks that a link exists for that user and environment. So one phished Clerk login, or a session token lifted from any signed-in device, is a shell on every machine linked to the account. The environment has no device list and no approval step, and Connect clients can't be given a narrower scope.The account behind all of this has one factor, and it doesn't have to be the password. I made my account with a long password and verified the email. Then I signed in on my phone, picked the emailed one-time code, entered it, and was in my environment with nothing else to confirm. T3's Clerk settings (
https://clerk.t3.codes/v1/environment) allow an email code, a passkey, or Apple, GitHub, Google or Microsoft sign-in as the first factor, and have no second factor enabled: authenticator app, SMS and backup codes are all off, andsign_in.second_factor.requiredis false. So the password protects nothing, I can't turn on MFA, and whoever can read my inbox gets a shell on every machine I've linked.The code doesn't have to be stolen from the inbox either. It travels over SMTP, where TLS is opportunistic: RFC 8461 notes that an attacker "who can delete parts of the SMTP session (such as the "250 STARTTLS" response)" or "redirect the entire SMTP session" "can perform downgrade or interception attacks", and the session then runs "over plaintext, despite both parties supporting TLS". A receiving domain can publish an MTA-STS policy in enforce mode, under which sending servers "MUST NOT deliver the message" to hosts that fail certificate validation or don't support STARTTLS. But that binds only a sending server that implements it (the RFC describes "what a conforming client should do"), and only on the last hop into the domain. The user controls neither T3's mail provider nor any relay in between, so nobody can make the code's path TLS-only end to end.
This gets worse as more people use one setup. In our office more colleagues will work on the same machines, and some have already asked to sign in to the same box with T3 Connect. An environment links to one Connect account, so today they either share that account's sign-in on their own devices or go without Connect, and every extra device holding the sign-in is another full key to every machine on the account. #27974 asks for several accounts per environment; that needs per-device approval even more.
docs/internals/t3-connect.mdsays the design "does not make a compromised relay signing key harmless", so I assume this is known. #3582 (client approval mode) would have covered most of it, and it was closed unmerged.What I'd like:
2. The tunnel passes everything through to the server.
The managed tunnel's ingress maps the hostname straight to the server's loopback port, with no path rules and nothing in front (
infra/relay/src/environments/ManagedEndpointProvider.ts). The hostname is a deterministic hash, not a secret. Anyone who has it reaches the whole server:/.well-known/t3/environment, which hands anonymous callers the exactserverVersionand the capability list;/wsupgrade.Auth works where it applies: API routes answer 401 without a credential. But a bug in any of the pre-auth code, or in the HTTP and WebSocket stack under it, is reachable from the internet. The version in the descriptor tells an attacker which bug to try.
What I'd like, smallest change first:
/.well-known/t3/environmentreturns only what pairing needs until the caller is authenticated, and leaves outserverVersionand capabilities.Related:
Written up with Claude Code from a session on one of the affected machines.
All reactions