Skip to content

Security: Dweej-Patel/passthrough

SECURITY.md

Security policy

Passthrough runs a root helper on the Mac and a network extension on the iPhone and iPad, so security reports are taken seriously.

Reporting a vulnerability

Please do not open a public issue. Use GitHub's private vulnerability reporting on this repository (Security tab → Report a vulnerability).

Include what you can of:

  • which component is affected (iOS app, tunnel extension, Mac app, root helper, PassthroughCore, vendored engines)
  • steps to reproduce, or a proof of concept
  • the impact you believe it has

You should hear back within a week. Fixes for confirmed issues are released as soon as they are ready, and you will be credited unless you would rather not be.

Scope

In scope: anything that lets an unpaired device or another process on the Mac use the proxy, anything that lets an imported VPN profile execute code or read files as root, and anything that bypasses the kill switch or IPv6 blocking while a VPN is up. That includes routes a network can push (DHCP option 121, IPv6 route information), which the kill switch's pf rules are meant to defeat, and a crash of the app or the helper, which is meant to leave the kill switch in place. By design, the kill switch lets through traffic to the private networks the Mac is directly on while Allow local network is on, link-local and link-scoped multicast traffic, Tailscale's own interfaces, and the Mac's replies on Passthrough's wireless link to the phone.

The cable control channel is in scope too. It assumes whatever is on the other end may be hostile: another phone plugged into the Mac, an app bound to the phone's loopback control port while Passthrough isn't running (reachable through adb), or a fake adb server on the Mac that answers itself. The pairing token is sent once, in answer to the code shown on the phone, and never again: each connection proves the pairing both ways with HMAC-SHA256 over fresh nonces (the phone first), the Mac hands over link and shell keys only after that, the phone tells a connection nothing about itself and acts on nothing privileged before the Mac's proof, and the SOCKS5 password is a separate value derived from the token. A pairing code is withdrawn after ten wrong guesses in all (each connection may send three before the phone closes it), so wrong guesses can't lock out the right code, and the phone closes connections that prove nothing within 10 seconds unless a code is showing. Anything that gets a token, a link key, a shell key or relay details out of this channel without the pairing, or lets a peer that hasn't proved it change what the phone or Mac stores, is a vulnerability. Deliberately pairing with a device (typing the code it shows) is not.

The control channel is authenticated, not encrypted. A process running as the Mac user can put itself between the app and adb (a fake adb server on 127.0.0.1:5037 that relays to the real one, or to the phone): the proofs pass through it untouched, and it can then read what is sent after them, the wireless link key, the shell key, relay details and, during a pairing, the new pairing token. That is out of scope: code already running as the user is outside the threat model (it can read the user's files and drive the user's apps). The fix would be an encrypted control channel bound to the pairing (keys derived from K and both nonces), which Passthrough does not have.

Notifications to phones (off until a phone asks and the Mac has a push key) go through Apple's push service, the one part of the remote shell that leaves the user's devices. A phone asks for them over the authenticated shell connection, handing the Mac its APNs device token and a key it made for that Mac; each notice's content is sealed with that key (ChaCha20-Poly1305, the phone's ID for the Mac bound in) and opened by the phone's notification extension, whose app group holds only those keys, never the pairing or shell secrets. Apple sees the device token, the time, the Time Sensitive flag and a session ID used to group notices. The Mac's APNs key (.p8) is built into the app bundle from a gitignored file that Config/Signing.xcconfig names, so anyone who can read the bundle can read it: a built Passthrough.app must not be given to anyone else (they could push to the team's apps until the key is revoked). Anything that lets content out unsealed, sends a phone notices it did not ask for, or reaches a phone's pairing or shell secrets from the notification extension is a vulnerability.

An iPad's Internet through iPhone is in scope. Its pairing with an iPhone has no cable, so the camera stands in for it: the QR code the iPad shows carries its certificate fingerprint and a one-time 32-byte secret, works once, and expires after five minutes, and the iPhone adds it only after Face ID or the passcode. The iPhone dials the iPad's pairing listener with TLS pinned to that certificate, so only that iPad reads the token and link key it sends, and proves the secret against the iPad's fresh challenge (HMAC-SHA256); the iPad keeps them only then, and the iPhone stores the iPad only once the iPad has kept them. A code naming a client the iPhone has paired as a Mac is refused, so a scanned code can never replace a Mac's pairing. Accepted limit: whoever photographs the code within its five minutes and reaches the iPad's listener before the user's iPhone does can pair the iPad with a device of their own, which could then carry the iPad's traffic when it links (seeing where it connects and anything not encrypted end to end). The user's iPhone is then told the code was already used, and the iPad shows the name of the iPhone it paired with; Pair again replaces it. They cannot pair a device of their own with the user's iPhone this way, since the iPhone's TLS reaches only the iPad in the code. The iPad's listener takes at most four connections at a time and stops after five wrong proofs.

Once paired, the iPad's link is the wireless link with the roles as for a Mac (TLS 1.3 pinned to the iPad's certificate, the link-key challenge, the same pre-proof limits), with two rules of its own: the iPhone links an iPad only over its Personal Hotspot interface, checked before it sends any proof, never over a Wi-Fi network both share and never peer-to-peer. The iPhone treats an iPad's streams as a Mac's: private, link-local, loopback and multicast destinations are refused (DNS to a private address is answered from the iPhone's own resolver). On the iPad the tunnel takes every route (includeAllNetworks, nothing excluded), so while the iPhone is linked, or while it waits for it on a known hotspot, nothing leaves the iPad except through the iPhone, and with no link streams fail at once rather than go out as hotspot data. On Wi-Fi it can only guess is a hotspot (iOS counts it as costly), it waits a minute for the iPhone to link and then steps aside, as it does at once on any other network. Its SOCKS forwarder listens on the iPad's loopback only, and every stream through it still needs the password derived from the iPad's token. Anything that sends the iPad's traffic out over the hotspot while it is linked or waiting on a known hotspot, links an iPad over anything but the iPhone's hotspot, or lets an iPad reach the iPhone's private networks is a vulnerability.

The Mac app reads its secrets only from the data-protection keychain, never the legacy file keychain, where any process running as the user could plant an item under Passthrough's name.

The Windows app's log (%LOCALAPPDATA%\Passthrough\passthrough.log), and the service's and setup's under C:\ProgramData\Passthrough\logs, must never hold a pairing token, a shell key, a relay token or a proof: everything written to it passes through a filter that removes them by shape (including as JSON escapes them), by field name (the pairing code among them), and by value once a relay token is loaded and registered with it. Endpoint ids and certificate hashes are public and are logged, so no secret is ever written as hexadecimal. A secret that reaches the log is a vulnerability.

The remote shell (off by default) is in scope end to end: the shell listener (pre-auth connection limits, the HMAC challenge, pinned TLS 1.3, the private/Tailscale address policy, and the built-in iroh endpoint), the key grant over the control channel, how the shell key is stored on the Mac and on phones (including while a new key waits for the phone app's next unlock: the iPhone's extension and Android's service keep it only sealed to a key that needs the unlocked app, a Secure Enclave key with user presence on the iPhone or one inside the Android shell key vault; a pending key readable without the user is a vulnerability), transcripts at rest under ShellHistory (excluded from backups; finished sessions deleted after the Keep shell history period, 30 days by default, and past 2 GB oldest first), and the consequences of a network-reachable app holding Full Disk Access. Anything that gets a shell, or a transcript, to a device that was not paired over the cable is a vulnerability.

On Windows, Remote access (off by default; Settings ▸ Remote access) is in scope the same way, as far as it goes today: Passthrough's own iroh endpoint (windows/native/iroh-bridge, a C ABI that must never crash or corrupt the app on any input from the network), the same handshake and limits, shells run as the signed-in user in Microsoft's bundled ConPTY inside a kill-on-close job, from a catalog of fixed paths (nothing a phone sends reaches a command line), never while Passthrough itself runs elevated, and transcripts under %LOCALAPPDATA%\Passthrough\ShellHistory. A shell grant goes out over the cable only when the far end of the control channel's connection is Apple's device service (the Apple Mobile Device Service's process, or Apple Devices' process as its package identity names it) or an adb server running as the same user in the same Windows session: a program standing in on usbmuxd's or adb's port may pair, never get a shell. Accepted limit: any program already running as the same Windows user could stand in for adb, or use the shells' environment; that is code running as the user, outside the threat model as on the Mac. Phones come in over iroh and, on Windows 11 and Server 2022, over the service's own TLS 1.3 listener on TCP 7893. Its firewall rule lets in only the local subnet, the private ranges and Tailscale's (100.64.0.0/10), and the same address policy and limits are applied before any TLS object exists. Remote access's background service is installed by the only code that runs as administrator: Passthrough.Service.exe --install, behind one Windows prompt. It takes no path arguments; it copies exactly the files files.json lists (no path that could leave the install folder, no link), from bytes it hashed, into a fresh administrator-only folder under Program Files; it refuses a data folder under ProgramData that anyone but administrators, SYSTEM or the service owns or can write; and it learns which account asked from the setup pipe's other end, never from an argument. Turning off, removing and changing settings run only from the installed copy. The service runs as its own virtual account with a write-restricted service SID and only the change-notify privilege (no impersonation); interactive users may query it, allowed accounts may also start it, and only administrators may stop, change or send it a control. Removing it deletes the service account's profile, and the service's keys with it. The service reaches each account's shells through its tray app over \.\pipe\PassthroughService: the service makes it first (no one else can hold the name while it runs), owned by its own SID, refusing remote clients, and no client may add an instance; the tray app checks the pipe's owner and server process are the service's before it sends anything, and connects at identification level. The service knows a tray app only by its token (account, session, elevation, integrity) and refuses session 0, elevated or low-integrity clients and accounts not allowed at install; no message names an account. Accepted limit: any program running as an allowed account, at medium integrity, can be that account's tray app; that is code running as the user. The service holds every phone's shell key (per Windows account: a phone belongs to one account and only ever reaches that account's shells) and its own iroh key, in DPAPI under its own account plus its folder's security; it never takes an iroh key from a user's store. A compromised service can do everything those keys allow, and ask every linked tray app to open shells: it can act as a shell for every signed-in account that uses it. It can't read user profiles, impersonate, or change its own install, its binaries or which accounts may use it. Relay tokens an administrator sets reach it through a file only administrators and the service can open, which it moves into its store. Screen on a PC is Windows' own Remote Desktop, relayed by the service to 127.0.0.1 only, for a phone with its Screen box on, granted by an account that consented behind an administrator prompt; screen-only passes are refused. Before any byte passes, the far end of the relay's connection must be TermService's own process (the TCP table's owner, no process opened), and the phone is told the SHA-256 of the certificate Remote Desktop presents, so a stand-in gets nothing. The relay reads the first plaintext PDU each way and closes any connection that doesn't use Network Level Authentication, so every relayed connection is one credential try; quick tries per grant are capped below Windows' account lockout (4 in 10 minutes, 12 in all). Where Passthrough turned Remote Desktop on, it keeps it closed to the network with its own block rules and refuses to relay (exposed) whenever it can't show they hold: Windows Firewall off for any profile, another program managing the firewall, a policy ignoring local rules, or a rule that overrides blocks. Where the owner already ran Remote Desktop open, Passthrough leaves it and says so. Accepted: Screen plus a Windows password is more than shell access (administrator prompts, the lock screen, any account allowed to sign in remotely, administrators always), and the password reaches Windows on the PC. Accepted limit: builds aren't signed, so a program already running as the user could change a build's files before the administrator prompt is approved; the hashes in files.json come from the same folder and prove only that the copy matches it. Known issue, partly handled: setup itself doesn't check who else can write to the build folder or its parents. A second drive such as D:\ lets every account on the PC modify files by default, so on a PC with more than one account another standard account could replace the build before the owner approves the prompt, and its code would run as administrator and be installed as the service. scripts/windows.ps1 checks this: build, install and update refuse a source or build folder that another account can change, or a folder above either that it can replace, unless -Force, and it builds into %LOCALAPPDATA%\PassthroughBuild by default. Setup run by hand (or Turn on from a build folder) doesn't check yet. Also known, low: any account can create the setup's global mutex first and so block setup verbs, or hold the service pipe's eight instances, delaying tray apps; neither reveals anything.

Computers (stage 7) on a PC host: a phone the owner allowed to share (Share, off by default) may give one of its other computers access to this PC's shell, the screen, or both (computerGrant). The PC mints the computer. id and key, keeps the computer's identity public key, and accepts a computer's proof only with that key's signature over the nonce, bound to this PC's certificate or iroh id, so a copied credential opens nothing. A computer may do only what its scopes say, checked on every request: no history, no lock, no Keep awake or VPN, no onward grant, no list of computers. Its screen waits for the owner to allow it at the PC, and only while the granting phone may see the screen itself. Removing or revoking the granting phone removes its computers and ends their connections and sessions; a phone may revoke any computer it granted at any time. At most 8 computers a phone, 16 in all. Anything that lets a computer exceed its scopes, outlive its granter, or see the screen before the owner allowed it is a vulnerability.

The PC as a viewer (Your computers): access to another computer that a phone hands this PC is kept wrapped with a key bound to Windows Hello, so it can't be used without Hello on this PC. On a PC without Hello (no PIN set up) the Windows password stands in: Windows' own credential prompt asks for it before the list opens and before a screen window, once per five minutes (a typed password stands that long, where Hello asks for every window), and Passthrough checks it with a sign-in as this same account and keeps nothing of it. The wrapping key is then a random one in this account's DPAPI store, which is weaker than Hello in one way: a program already running as this account could read it without asking. Someone at the unlocked PC still can't open another computer with a click. What the password sealed keeps opening with the password after Hello is set up, and what Hello sealed is never opened or replaced by the password: while Hello is away (in a Remote Desktop session, say) the list stays shut. A new shell on another computer runs passthrough-term.exe in Windows Terminal, connected to the tray app over a pipe that only this account can open, under a one-time random name, and the tray checks that the connecting process is its own passthrough-term.exe. Nothing the other computer chose (its name, its shells) reaches Windows Terminal's command line. A Mac's screen arrives as the same video stream a phone gets; frame sizes are checked before decoding. Accepted limit, as on the Mac: anyone who learns a host's iroh endpoint id can hold the handshake slots kept for attempts through relays (eight), delaying phones that come that way; direct attempts and the slots kept for proven addresses are unaffected, and nobody gets in without a phone's key.

Terminals on the Mac are in scope: the Unix socket terminal windows connect to (its permissions and the check of each connection's user), what a connection may ask of the app, the lines Passthrough writes into the user's shell startup file and the script they call, and that those lines fail open (a terminal that cannot start without Passthrough is a bug). Those shells run inside Passthrough with its privacy permissions, so the socket is a way to them for any process of the user's: without Show new terminals on my phones, a connection that gets a new session, the session list, or a running session without the one-time token Passthrough wrote for that session's window when the owner clicked Open here is a vulnerability, as is a token that works twice or after its minute. The token is readable by any process of the user's, so one that reads it may ask first: the window Passthrough opened then asks with the same token, and that second use must take the session off the Mac's windows and tell the owner. Accepted limit: a process that reads the token at that moment and also keeps the opened window from asking (by changing what it runs) is not caught; a process with the user's rights can do that to any terminal window. With the setting on, a phone with shell access reading and typing into the Mac's own terminals is by design, and so is a process running as the user starting a shell with Passthrough's privacy permissions through the socket: that is what the setting does.

Screen (off for every phone by default) is in scope too: the per-phone Screen permission, the hand-over of an authorized connection to the screen stream or to the Screen Sharing relay on loopback, the stream's binary messages as the Mac parses them, the input it posts as the user's own events, and the consequences of a network-reachable app holding Screen Recording and Accessibility. The stream asks for no Mac password by design (the Screen switch is the consent). Anything that shows the screen to, or takes input from, a phone without that permission is a vulnerability, with one exception by design: shells inherit Passthrough's privacy permissions, so while Screen Recording and Accessibility are granted, a phone with shell access can capture the screen and post input with command-line tools. Shell access is already full control of the user account, so the Screen switch gates only Passthrough's own stream and the Screen Sharing relay.

The clipboard is in scope as well. Phones: text from the Mac reaches the phone's clipboard only on a user action (Copy in the terminal or in Screen) or a program's OSC 52 copy in an attached, writable terminal, and Screen's Copy returns only a change to the Mac's clipboard in the moment after its own ⌘C (a second on the stream, two over Screen Sharing), never what was already there. Something else copying on the Mac inside that window would be taken as the ⌘C's; that window is the accepted limit. On the iPhone it is kept off Universal Clipboard and cleared after two minutes. The Mac never reads the phone's clipboard; the phone sends it only on Paste. A paste into the shell is stripped of escape and control characters, so it can't inject terminal commands or end a bracketed paste. Anything that moves clipboard contents between a phone and a computer without those actions, or lets a paste run commands the user didn't see while the shell asked for bracketed paste, is a vulnerability.

Computers viewing each other's screens sync their clipboards automatically, by design, while a viewer's window is open (clipSync, protocol/README.md): what's copied on either is on the other's clipboard, files included (up to 500 MB in all for a copy), and files dropped on the viewer's window are dragged to that point on the host. The gate is the screen's: only a screen pass or a computer with the screen scope may ask, only while the host is showing its screen to that same id, never a phone; the host's owner can turn it off (Settings ▸ Remote Shell ▸ Computers with access), and the viewer has a switch in its window. Contents marked secret or fleeting (password managers' Concealed and Transient types on a Mac, and the iPhone's Universal Clipboard; on Windows CanUploadToCloudClipboard and the other exclusion formats) are never synced, and a Mac keeps what it received off Universal Clipboard. Received files are written only under the receiver's own folder for them: a name that leaves it (.., an absolute path, a separator hidden behind a combining mark or read differently by the platform), a transfer larger than it said, or more data than an item's size is refused, and a receiver takes at most 4 transfers at once within its free space. A viewer takes no drops from its host. A drop lands in whatever window is at the point on the host, as a drag there by hand would, including another app that takes files; that is the feature, but only on the window that was there when the drop was offered: if another has come up by the time the files are all there, they go to Downloads. Received files are quarantined (Mark of the Web on Windows), so Gatekeeper or SmartScreen asks before a received app, installer or script is opened, and a sender reads only the plain files that were copied, never a link swapped in since. Accepted limits: anything that copies on one side while a view is open is on the other side's clipboard, including copies made by other programs and text piped to pbcopy (nothing marks it secret); a viewer that can see the screen could already read what's on it. A compromised computer on the other end can replace this side's clipboard whenever it likes, including just after a copy here, so check what you paste from a computer you don't trust. A viewer's copy goes on to the host's other viewers too. The host keeps what it received (the last 3 copies, the last 5 drops) until Passthrough next starts. A drop goes to the window that was at the point when it was offered, judged by the window, not by what it shows: a folder window that has since moved to another folder still takes it. A phone that may see the screen can make itself a screen pass and so sync the clipboard; it can already see and control the screen. Anything that syncs a clipboard to a device that isn't viewing the screen, to a phone, or with the setting off, writes a received file outside that folder, or reads a file on the sender that wasn't copied or dropped, is a vulnerability.

Internet-reachable iroh endpoint. With Reach this Mac from anywhere (built-in) on (the default while Remote shell is on), the Mac runs an iroh endpoint that accepts connections from the internet. That is by design, so the shell's own authentication is the gate. The pre-auth surface is not limited to holders of the endpoint id: anyone who can reach the endpoint's UDP port directly (on the same LAN, or over public IPv6) can start a handshake, as can anyone who knows the endpoint id and reaches it through a relay. Every such attempt is bounded: a slot is taken only once QUIC has validated the peer's address (a retry round trip), and at most 16 connections are unproven at once (2 per remote IP on direct paths, a public IPv4 address counted by its /24 and IPv6 by its /64, a link-local one by itself; 8 arriving through relays; 4 kept for addresses that proved a shell key in the last 30 days), each gets 10 seconds from the moment it arrives (before the QUIC handshake), and its hello and proof lines are limited to 4096 bytes (a hard limit). Nothing is read past the proof until the phone proves its per-phone 256-bit shell key with the HMAC challenge. On this path the transport encryption is iroh's QUIC (TLS 1.3, end to end between phone and Mac, the Mac authenticated by its endpoint id, which is its public key); there is no further pinned TLS inside the stream, and the HMAC shell-key proof is the authorization. The endpoint id and relay are sent only to phones that have authenticated (in macInfo) or over the cable; they are not secret in the cryptographic sense, but are not published anywhere. Relays see both endpoint ids, source and destination IP addresses, timing and traffic volume, never content. The default relays are run by a third party (n0) with no uptime guarantee. A custom relay is configured on the Mac, and its access token is stored in the Mac's Keychain; the Mac also gives that token to paired phones (in the cable grant and in macInfo) so they can use the relay, and phones keep it in their secure store (the iPhone's Keychain; on Android, storage encrypted with a Keystore key), so a lost phone holds it. To rotate it, change the token on the relay and in the Mac's settings: phones get the new one the next time they connect on any path. A phone dials the Mac's relay as it was last given; if the Mac's home relay moves, a phone that is away reaches it again after its next connection on any path (local, Tailscale, or iroh directly) brings the new one. The Mac's endpoint secret key is also in the Keychain (it is its identity, not a shell credential); Reset built-in identity... replaces it. Phones use a fresh ephemeral endpoint key for every connection attempt and store none. Turning the option off removes the endpoint entirely. Weaknesses in any of this are in scope.

Out of scope: the fact that a carrier might detect tethering. That is documented as a known limit, not a bug.

There aren't any published security advisories