Hopwire Hopwire

Security Pre-release

Security

Hopwire has two modes, and they make different promises. Every tunnel prints its mode as its first line, so you always know which one applies.

Private mode

No account, no servers of ours, end-to-end encrypted between you and the teammates you choose.

This claim applies to private mode only. Public mode needs an account, and its requests pass through the edge.

The short version

  • Captured traffic is stored on your disk and nowhere else, unless you share the log with teammates.
  • The edge and the control plane never store request or response content.
  • There is no telemetry in either mode: no analytics, no update check, no crash report.
  • Captured traffic is not redacted. The log holds headers and bodies as they arrived, credentials included.

The full reference, with every file, header and log field, is in the docs: Security and privacy.

Private mode

Private mode is the default. A plain hopwire http <port> opens no network connection beyond loopback. Sharing is opt-in, per run, with --share.

What it guarantees

  • Connections run directly between the two machines over HyperDHT and are encrypted with Noise between your key and your teammate's key. There is no server of ours in the path and no relay.
  • A teammate's log is read-only on the watcher's side. Replays in hopwire watch go to the watcher's own loopback target and are written to the watcher's own log, never to yours.
  • With an allowlist (--allow), every other key is refused before it can exchange a byte with your service or your log.
  • Private mode never contacts the edge or the control plane. A login stored on the machine is not even read unless a tunnel is public.

Where it stops

  • Teammates with the log key see everything captured. Headers and bodies as captured, including credentials.
  • The shared log is the whole log of the data directory, earlier runs included. Share from a fresh one with --data-dir if it holds traffic your teammate should not see.
  • Without --allow, the peer key is not a secret. Anyone who knows it can reach the shared service, and anyone with the log key can read the log.
  • DHT nodes see metadata. The nodes of the public HyperDHT see IP addresses, public keys and discovery keys. They never see content.
  • Your teammate learns your IP address, and you learn theirs. The connection is direct.
  • Sharing cannot be taken back. hopwire watch downloads the whole log to the watcher's disk. Stopping your tunnel does not remove their copy.
  • No relay. When no direct connection is possible, the CLI says so and exits. It does not fall back to a server.
  • A public tunnel is not private. With --public and --share together, the private claim is not printed.

Public mode

Public mode (--public) is not end-to-end encrypted. The path of a request is: client, HTTPS to Cloudflare's edge, our Worker and one Durable Object per subdomain, a WebSocket that your CLI opened outbound, then plain HTTP to your service on loopback.

A public URL is not a secret

Anyone who knows a public URL can send requests to your local service. To put a password in front of it, set auth.basic in hopwire.yaml. The edge then answers 401 before the request reaches your machine and keeps only the SHA-256 hash of the credentials, for as long as the tunnel is connected.

The edgeWhat
seesEvery public request and response in full, in transit, because it carries them. The connect token of your CLI and the subdomain it asks for.
storesNo paths, no headers, no bodies, no WebSocket messages. With the open socket of your CLI: the subdomain, the time it connected, the expiry of its token and, with Basic Auth, the hash of the credentials, plus the organisation, its plan and what the tunnel has left of today's limits. This goes away with the connection. Per organisation: the numbers of each UTC day (requests, bytes, in-flight time), kept for 8 days, and which of its subdomains have a tunnel online.
logsOne JSON line per event with event, subdomain, reqId, status, durationMs, error, closeCode and meter (the name of a daily limit that was reached), and nothing else.

Tokens

  • API token (hw_ and 40 characters): identifies your account to the control plane, in the organisation it was created in. Shown once when you create it. It never goes to the edge.
  • Connect token: what the CLI shows the edge. The control plane signs it (Ed25519); it names one subdomain and is valid for 300 seconds. It also carries the organisation, its plan and the plan's limits, so the edge enforces them without asking the control plane. The edge verifies the signature itself and never calls the control plane.
  • Revoking an API token ends a running tunnel at its next renewal, at most 150 seconds later. hopwire logout alone does not revoke a token.

The control plane

The control plane is used by public mode only and sits outside the data path. It issues connect tokens and never sees a request to your tunnel. It stores:

  • Account: name, email address, a bcrypt hash of the password.
  • API tokens: the name you gave it, a SHA-256 hash of the token, its first 8 characters for display, its status and when it was last used. The token itself is not stored.
  • Organisations: the name, the members with their roles (owner, admin, member) and invitations (the invited email address, who invited, when, and the status). Plans, limits, names, API tokens and usage belong to an organisation; every account has a personal one.
  • Subdomains: the fixed URL of each organisation and the names it reserved. A released name stays with its organisation and is never given to another one.
  • Plan and billing: the plan and the subscription, the billing name and address, the invoices issued, and the outcome of payment notifications from Stripe.
  • Usage: per organisation and UTC day, the numbers of requests, bytes and in-flight time, fetched from the edge every 5 minutes, and which limit emails went out. Never paths, headers or bodies.
  • Web sessions: the session record, with the IP address and user agent of the browser.

Sign-in, registration and password reset are rate limited. A password reset revokes every active API token of the account and ends its other sessions.

Plans and limits

Public tunnels run under the plan of an organisation, and the edge enforces its limits.

  • Usage is counted at the edge, in public mode only: numbers per organisation per day (requests, bytes, in-flight time); the tunnels online are checked live. Never paths, headers or bodies. Private mode is never counted.
  • At a limit the public URL answers 429 until 00:00 UTC. There is no overage.
  • Limit emails go to the owner and the admins of the organisation at 80% and 100% of a daily limit.
  • Billing runs through Stripe. Card details are entered on Stripe's pages and do not reach the control plane.

On your machine

Everything lives in one data directory: ~/.hopwire, or $HOPWIRE_HOME, or the path you pass with --data-dir <path>.

PathWhat it holdsMode
store/The traffic log and its key material. In hopwire watch, also the copy of the teammate's logdirectory 0700
identity.jsonThe Ed25519 key pair of this machine0600
config.jsonThe API token and the URL of the control plane it belongs to0600
Nothing is redacted

Authorization headers, cookies, API keys and webhook signatures are stored as captured, and the log is not encrypted on disk. Treat the data directory like a file of secrets. Use test credentials and sandbox webhooks while a tunnel is public or shared.

The inspector binds to 127.0.0.1 only, and there is no option to expose it. It refuses requests whose Host header is not its own loopback address and port, refuses state-changing requests from another origin, and loads nothing from other hosts. It has no login: whoever can open a connection to that port on your machine can read the log and trigger replays.

Threat model

Hopwire protects against

  • Someone on the network between you and a teammate. Private connections are encrypted end to end. An observer sees that two addresses talk, not what they say.
  • Strangers reaching a shared service, when you use --allow.
  • A web page you visit trying to read your inspector. The Host and Origin checks stop it.
  • A hostile log. Every entry of a teammate's log is validated before it is listed, printed or replayed.
  • A leaked connect token. It is valid for 300 seconds and for one subdomain.
  • A leaked control-plane database. It holds token hashes and password hashes, not tokens or passwords, and no traffic.
  • Requests forged to look internal. A public client cannot set the edge's internal headers and cannot choose X-Forwarded-Host or X-Forwarded-Proto.
  • A token sent over an open connection. The CLI refuses ws:// and http:// for anything that is not on this machine.

Hopwire does not protect against

  • Someone with access to your user account or your disk. The files are owner-only, not encrypted.
  • Other programs and users on your machine. The entry point, the inspector and the local port of hopwire connect listen on loopback without a password.
  • A teammate you gave the log key to. They see everything captured, and they keep their copy.
  • Secrets inside the traffic. If a request carries a production credential, the log carries it too, and so does every copy of a shared log.
  • The public internet reaching a public URL. Without auth.basic, anyone who learns the URL reaches your service.
  • The edge itself. In public mode, Cloudflare and our Worker carry your traffic in clear. Use private mode for what the edge must not see.
  • Metadata in private mode. DHT nodes see IP addresses, public keys and discovery keys.
  • What a replay does. A replay sends a real request to your local service. If that service charges a card or sends an email, the replay does it again.
  • Your local service. Hopwire forwards to loopback addresses only, but it does not harden what listens there.

Report a vulnerability

Please do not open a public issue, pull request or discussion for a security problem. Report it privately:

  • Email: [email protected]. If you want to encrypt, ask for a key in a first message without details.
  • GitHub: the "Report a vulnerability" button on the Security tab of the repository (private vulnerability reporting).
Not published yet

[email protected] receives mail. The repository is not public yet, so there is no Security tab to report through; that channel opens with the first release.

Please include:

  • the component and version (hopwire --version, or the commit), your operating system and Node.js version
  • what an attacker can do, and what they need first (a peer key, a log key, a public URL, local access, an account)
  • steps to reproduce, ideally against a local setup
  • whether you want to be credited, and under which name

What happens next

Hopwire is maintained by one person. These are the times we can keep, in working days (Monday to Friday, Central European Time).

StepTarget
Acknowledge your report3 working days
First assessment (confirmed or not, severity)10 working days
Fix released for a confirmed critical or high issueas fast as possible, target 30 days
Coordinated public disclosurewhen a fix is released, or after 90 days, whichever comes first, unless we agree on another date

We keep you informed, credit you in the release notes and the advisory if you wish, and publish a security advisory for every confirmed vulnerability in a released version. There is no paid bug bounty.

Supported versions

Hopwire is before 1.0. Only the latest release gets security fixes. Please check that your report applies to it.

In scope

  • the hopwire CLI: the interceptor, the traffic log, the P2P engine (--share, connect, watch, --allow), the edge bridge, hopwire.yaml handling, hopwire login and the stored token
  • the local inspector on 127.0.0.1:4040: its API, Host and Origin checks, replay, Content-Security-Policy
  • the protocol package: frame and message decoders, validation of a teammate's log
  • the edge Worker and Durable Object
  • the hosted service and the account site, for issues such as a tunnel reaching another account's subdomain, bypassing edge Basic Auth, forging or reusing connect tokens, or reading another account's data

Especially welcome: anything that lets content leave a machine in a way the documentation does not say, anything that lets a peer without the right key reach a service or a log, and anything that lets a web page talk to the local inspector.

Out of scope

  • denial-of-service or load tests against the hosted edge or the account site
  • social engineering, phishing of maintainers, physical attacks
  • attacks that need an already compromised machine or an account on it with the user's rights
  • reports from automated scanners without a demonstrated impact
  • missing hardening headers on pages with no sensitive action, unless you show an impact
  • vulnerabilities in dependencies that Hopwire does not reach; please report those upstream

Documented behaviour

These are documented, not a vulnerability by themselves. Reports that show more than what is documented are welcome.

  • The nodes of the HyperDHT see IP addresses, public keys and discovery keys, never content.
  • A teammate who has the log key sees everything that was captured, headers and bodies included, for the whole traffic log of the data directory.
  • The peer key is not a secret. Without --allow, anyone who knows it can reach a shared service with hopwire connect.
  • On a public URL without Basic Auth, whoever knows the URL can reach the service and can hold the WebSocket places of the tunnel.
  • Requests in public mode pass through the edge; the private-mode claim does not apply to them.

Testing

Please test against your own setup, never against another person's tunnel or account.

  • Run everything locally: a local edge under wrangler dev with a dev token (public mode), and a local HyperDHT testnet through HOPWIRE_DHT_BOOTSTRAP (CLI reference).
  • On the hosted service, use only accounts and tunnels you own, keep request volume low, and stop as soon as you have shown the issue. Do not access, change or keep data of other users; if you reach any by accident, stop, tell us, and delete it.

Safe harbour

If you act in good faith within this policy, we will not take legal action against you and will not ask anyone else to, for the research covered by this policy. If in doubt about a test, ask us first at the address above.