RemoHop

中文

Docs

RemoHop security model

This document describes what RemoHop protects, against which threats, and what it does not protect. It is written for people who run a host, people who connect to machines with remohop, and people who let AI agents or a browser gateway use RemoHop. The design is summarised in ARCHITECTURE.md; this page covers the user-facing consequences.

RemoHop has not had an independent security audit. The mechanisms below are described from the code and its tests, and the limits are stated as they are.

Summary

Actors and what they can do

ActorCanCannot
Network observer between the machinessee that UDP traffic flows, its size and timingread commands, files or screen contents; learn the password
Rendezvous server (remohop signal) operator, or a compromise of itsee which IDs are online, their public addresses and when they connect to each other; refuse to introduce peers, or go down; when it relays a session, see that session's ciphertext, size and timing, and throttle or drop itdecrypt or join a session; impersonate a host to a client that has pinned its key; test passwords offline
Active attacker on the path, including a malicious rendezvous serverblock or disrupt traffic; cause connections to failcomplete the login without a credential; read session data
Someone with a host's ID but not its passwordattempt password guesses, subject to the limits belowlog in; obtain a token
Rendezvous server with accounts onsee which devices belong to an account and when they are online; refuse service; withhold the newest membership entries from a deviceadd a device to an account; log in to a host; forge the signed member list; read a session
Client that has paired or been authorisedeverything the host's user can do, within the allowed features (see below)use its credential from a different identity; keep access after remohop host revoke
Host operator (the machine owner)everything on that machine; see every command, file, clipboard item and keystroke a client sends; with VPN --exit, see the client's traffic as it leaves the tunnelnothing is hidden from them; they control the machine
Operator of a browser gateway (remohop web)see and change everything that passes through the page, and use the gateway's saved pairingsnothing is hidden from them, see Browser gateway
Someone with read access to your diskread whatever is stored in the config directory (see "Secrets on disk")nothing beyond that, unless they also get the process

Rendezvous server

The rendezvous server is untrusted by design:

A malicious server can lie about addresses, which only prevents a connection, because the login below fails. It can refuse service and it sees the metadata: which IDs connect and when. There is no built-in default server; you choose and run your own.

To stop a client from accepting a different rendezvous server than you intend, pin its key:

remohop config set signal-pin KEY

remohop signal prints its public key on start. A client refuses a rendezvous server whose key does not match the pin.

Accounts

Accounts are optional and off by default. The rendezvous operator enables them with remohop signal --accounts. A person logs in with an email address (remohop login) and the server mails an 8-digit code (valid 10 minutes, single use; five wrong codes burn it and lock the address for 15 minutes).

What an account is for. It groups your devices so each can list the others and see which are online. It grants no access. Connecting to a host still needs a password, a pairing or a key that the host accepts.

The one exception: account-trust. A host whose owner ran remohop config account-trust on (default off) accepts the account's other devices like keys authorised with remohop authorize. Their keys appear in remohop host paired as account:NAME. The host's ask-paired setting applies to them. remohop host revoke of one keeps that device out until account-trust is turned off and on again.

How membership is protected. The membership of an account is an append-only, hash-chained log. Each entry is signed with the identity key of a device that is a member at that point: the first device creates the account, an existing member signs each addition, and any member can sign a removal. The hash of the first entry is the account ID. The server stores and relays the log but holds no member key.

Joining a device. Two comparisons make this safe against the server, and both are required:

  1. The new device shows the account fingerprint. Confirm it equals the one remohop account shows on a device already in the account (scripts pass --account-fingerprint).
  2. The new device prints its own identity fingerprint. On an existing device, run remohop account approve FINGERPRINT with the complete value. A prefix is refused.

Both fingerprints are 80 bits of SHA-256, so the server cannot grind a key that matches. Compare them over a channel you trust, not over the mail the code came in. A device keeps the account ID it confirmed, and it rejects a log that does not extend the longest one it already verified.

What a malicious or compromised rendezvous server can do:

What it cannot do: add a device to an account, log in to a host (even one with account-trust on), read a session, or forge the member list.

What remains your job. Compare the fingerprints for real. Anyone who controls a device that is already in the account can add other devices and, for hosts with account-trust on, can log in to those hosts. Remove a lost device with remohop account remove as soon as you can, and consider account-trust only for hosts where that risk is acceptable. The mail server and the email address are trusted only to deliver the login code.

The server's account file is accounts.journal in its data directory, indexed by a hash of the address, with session tokens hashed and codes never stored. RemoHop has not had an independent audit of this design.

Mesh network and Tailscale

remohop net (see net.md) joins the devices of one account into an IP network. What it rests on:

Tailscale. RemoHop reads Tailscale's status (local API, CLI or interface) and, when both machines are on one tailnet, uses the peer's tailnet address as one more path for the same session. Nothing Tailscale says is taken as identity: the session over a tailnet is authenticated by RemoHop's login and host key pinning exactly as over any other path. A stub status (REMOHOP_TAILSCALE_STATUS) or a lying Tailscale can only make RemoHop prefer or try a path; it cannot make a session succeed without the credential and the pinned key. REMOHOP_TAILSCALE=off turns the detection off.

Relay

A relay is off unless the rendezvous operator runs remohop signal --relay. It is used only after hole punching has failed, and it carries the same QUIC session with the same login:

Websocket bridge

remohop signal --ws-listen serves a websocket bridge for peers whose network lets only HTTP(S) out. It is off by default. Each WebSocket connection gets its own UDP socket on the server, and each binary message carries one datagram and a port number.

Public relay servers

An operator who offers the relay to the public (see public-server.md) limits it as follows. Rendezvous stays open and keeps its own rate limits:

None of this changes what the relay can see: ciphertext, both addresses, timing and volume.

Session establishment and authentication

  1. QUIC is set up over UDP. TLS 1.3 inside QUIC encrypts the traffic, but the peers have no certificate authority, so TLS alone does not say who the peer is.
  2. On the first stream, both sides run CPace over the credential (password or token). The TLS exporter of this exact connection is mixed into the key derivation, each side binds its identity key into the exchange, and each side proves knowledge of the key in a confirmation step.
  3. A man in the middle ends up with a different TLS exporter on each leg. The two legs derive different keys, the confirmation fails, and the attacker learns nothing useful for guessing the password.
  4. The password is never sent. An attacker who records a failed login cannot check candidate passwords offline.

Passwords and rate limiting

A host has one password at a time:

Failed logins are limited by the host (internal/auth/limiter.go). With its defaults:

Online guessing at this rate is slow, but not impossible against a weak password. Prefer pairing or key authorisation to typing a password, and consider remohop config ask on for hosts whose password is shared.

Pairing, authorised keys and identities

Pairing. remohop <ID> pair asks the host for a random 256-bit token bound to the client's identity key. The client stores it in peers.json. Later connections present the token instead of the password. remohop host --no-pairing refuses pairing.

Authorised keys. A client can log in with its identity key alone:

  1. On the client, remohop key export prints one line with the public key.
  2. On the host, remohop authorize "LINE" authorises that key and prints the host's own key line.
  3. On the client, remohop peers trust TARGET "HOST-LINE" records the host's key.

No password is involved, so there is nothing to guess, and the host's key is pinned from a line you received from its owner instead of on first use. The exchange is only as trustworthy as the channel you used to pass the two lines.

Revocation. remohop host paired lists pairings and authorised keys. remohop host revoke NAME|ID... removes them, and open sessions that used them are closed within seconds. On the client, remohop peers forget discards the saved token and key.

Identity management. remohop key export --private FILE writes the private key to a file with mode 0600 so that remohop key import FILE --yes can move the identity to another machine. Delete that file once imported: it is a full copy of the machine's identity. remohop key gen --yes and remohop key clear --yes discard the identity for good: every pairing and authorised key that hosts hold for it stops working, clients that pinned it as a host refuse it, and a host on this machine gets a new ID.

Device names. remohop config set name NAME is shown to peers in ping, approval prompts and remohop status. A name is whatever the other side chose to call itself. When you approve a login, judge it by the identity fingerprint and source address, not by the name.

Host access control

The host's owner decides what clients may do. Changes take effect at once, also for sessions that are already connected:

Host identity and key pinning

Each machine has an Ed25519 identity key in identity.key in its config directory. A host's fingerprint is shown by remohop status on the host and remohop peers on the client.

On the first successful password login, the client records the host's key ("trust on first use"). That login succeeds only if the host proved the password on that connection, so an attacker who does not know the password cannot be pinned in. For a sensitive host, compare the fingerprint through a channel you trust, or use remohop peers trust with the host's key line.

On later connections, a different host key is refused before the client sends any login message:

host identity has changed: <target> now presents key <new> but <old> was pinned on first login. Someone may be impersonating the host. If the host was reinstalled, run `remohop peers forget <target>` and connect again

A host started by hand and the same machine's installed service are two instances with two identities and two IDs. Only run remohop peers forget after you know why the key changed.

What an authenticated client can do

A client that passes the login gets the host's services, and those services run as the user that runs the host. With every feature on, a client can:

Below the feature switches, the only finer permissions are grants (see Host access control and agents.md): a client that logs in with a grant's credential gets what the grant allows and nothing else. Otherwise, pair only machines you trust, switch off features you do not need, and revoke pairings that you no longer use. A host installed as a system-wide service runs as root (or LocalSystem on Windows) unless you chose otherwise with --run-as; a client of that host has those privileges.

What a host can do to a client

A host does not get services on your machine. Hosts export services, and a client exposes local services only to sessions it opts into. A host cannot open a shell, read files or use the clipboard on your machine by itself. But several commands you run give the host a way in, and you should know which:

Treat any output from a remote machine as data, not instructions. This matters most for AI agents, which can be steered by text in command output, files or screenshots.

Windows unattended access

remohop service install --unattended (Windows only, from an elevated prompt) changes what a client of the Windows service can do. Without it the service runs as LocalSystem in session 0 and sees no desktop. With it, a client that passes the service's login sees and controls the session on the physical console, whoever is logged in there or nobody, as LocalSystem:

What does not change: who may log in. The service's password, pairings, authorised keys, approval (remohop config ask on), one-time passwords, feature switches (screen, input) and the audit log apply exactly as before; --unattended grants nothing to anyone by itself. It is the reach of an authenticated client that grows, from session 0 to the console, so treat the service's credentials like the machine's administrator password. Nobody at the console is asked or told; there is no on-screen indicator yet. Reinstall without the flag to turn it off.

How it is built (internal/unattended), and what each part prevents:

Windows VPN driver

The Windows VPN client needs the Wintun driver. remohop does not ship or download it. It looks for wintun.dll in REMOHOP_WINTUN_DIR, next to remohop.exe, in the config directory and on PATH, and accepts only the build whose SHA-256 it has pinned (Wintun 0.14.1). It copies the matching file into a directory only the current user can write and loads it from there, because the DLL runs with Administrator rights. A different file with the same name is refused.

Mobile apps

The Android and iOS apps are controllers only. Each is a native shell with a WebView on an in-process remohop web gateway, so the browser gateway caveats apply, with the gateway running on the phone. The access token is in the URL the app loads. The apps keep their identity and pairings in the app's private directory. The iOS app has only run in the iOS Simulator in CI, and the Android app has had no real-device test.

Local listeners on the client

Several commands open a listener on this machine. All of them bind to 127.0.0.1 by default:

Browser gateway

remohop web serves a browser client. A browser cannot hole-punch or speak the QUIC session, so the gateway process is the client: it speaks the end-to-end encrypted session to the host and serves the page. That has consequences:

Protections:

Use only a gateway you control.

Quick support window

remohop quick (and RemoHop.exe / RemoHop.app, which run it) is a host plus a local page that shows the ID and the temporary password, asks about each connection and lists sessions. Its rules are fixed in code and cannot be loosened from the config file: every login needs approval (pairings and authorised keys too, refused after 60 seconds without an answer), only the temporary password of the run is accepted, no pairing is minted, and only the features ticked in the window are offered (features switched off in the config file stay off).

Secrets on disk

The config directory is $REMOHOP_CONFIG_DIR, or the platform default. An installed system-wide service keeps its own: /var/lib/remohop on Linux, /Library/Application Support/remohop on macOS and %ProgramData%\RemoHop on Windows.

On Linux and macOS the directory is created with mode 0700 and the files below with mode 0600. Windows has no mode bits: RemoHop sets an owner-only access list on its configuration directory, and the Windows service keeps its state under ProgramData restricted to SYSTEM and Administrators.

FileHolds
identity.keythe machine's Ed25519 identity key
peers.json (client)pinned host keys, pairing tokens, aliases
paired.json (host)pairing tokens and authorised keys
config.jsonsettings, including a fixed host-password if set
usb-allow.json (host)the USB devices the owner allowed
audit.jsonl (host)the audit log
grants.json (host)grants: names, limits, expiry; their credentials are in paired.json
recordings/ (host)asciicast recordings of granted sessions made with --record; they contain whatever the commands printed
signal/ (rendezvous server)the server key and the ID table
jobs/ (host)background job records and logs; logs contain whatever the job prints
clip/clipboard history; on a host, clip/host records what passed through its clipboard during sessions. It contains clipboard text verbatim
wake.json (client)names saved with remohop wake --save

Nothing in the config directory is encrypted at rest. Clipboard history can hold copied passwords; remohop clip history off stops recording and remohop clip history clear removes entries. The service definition written by remohop service install never contains the password. A --password-file for remohop web and a key export --private file are secrets of their own.

MCP server and agents

remohop mcp runs as a child of the agent host and speaks MCP over stdio:

Limits and known gaps