Skip to content

remote: decide the plaintext-address rule by the address alone, for every team - #2111

Open
fujibee wants to merge 2 commits into
mainfrom
fix/e2ee-endpoint-pull-set-endpoint
Open

fujibee wants to merge 2 commits into
mainfrom
fix/e2ee-endpoint-pull-set-endpoint

Conversation

@fujibee

@fujibee fujibee commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Refs #2067

What was wrong

The plaintext-address rule gave different answers for the same address depending on the command:

So an encrypted team could be connected to http://agmsg.example, but could not be pulled onto a second machine from that address, or moved to it.

Change

The rule is now decided by the address alone, before any request, for every command (connect, pull, set-endpoint, and every sync cycle) and every team, encrypted or not:

  • Accepted: https://, or http:// to a local, LAN or Tailscale address: loopback, 10/8, 172.16/12, 192.168/16, link-local, fc00::/7, 100.64/10, *.ts.net. ZeroTier networks normally use RFC1918 ranges.
  • Refused up front, with the stated reason: http:// to any other address. Nothing crosses the network before the refusal.

The reason for removing the age-v1 exemption: sealed message bodies do not cover the team id, the endpoint path (which can carry a capability token), or the sync metadata. Over plaintext http:// to an internet address, all of that can be read or changed on the way.

In detail:

  • cmd_connect (scripts/remote.sh): validates the endpoint whether or not --e2ee is given.
  • connectedBinding (scripts/internal/remote-sync.mjs): no longer exempts age-v1, and reports the validator's own reason plus the set-endpoint command that moves the team. Before, it had a shorter copy of the allowlist that left out fe80::/10 and the Tailscale forms.
  • The refusal text: no longer offers --e2ee as a way past the rule, and says the rule applies to encrypted teams too.
  • pull and set-endpoint: unchanged. They already refused up front.

Upgrade effect. An age-v1 team that an earlier version connected to an internet http:// address stops syncing. The engine refuses its binding before any request. remote status shows last fatal: connected team endpoint is refused: … with the reason and the way out: remote.sh set-endpoint --endpoint <url> <team> to an https:// address or a local/tailnet one. sync start on such a team reports only that the engine did not become ready, as it already does for every fatal start.

No new environment variable, flag or process spawn.

Tests

  • tests/test_endpoint_table_node.bats: the shared verdict table now runs through connectedBinding twice, as a plain binding and as an age-v1 one. On main, the 42 refuse rows fail for age-v1.
  • tests/test_remote.bats:
  • tests/test_endpoint_scheme.bats: the refusal must not offer --e2ee. Fails on main.

Passing locally:

  • test_remote, all pass
  • test_endpoint_table_node, all pass
  • test_endpoint_scheme, all pass
  • test_remote_engine_start_refusal, all pass
  • node --test tests/remote_sync_engine.test.mjs: 161 pass
  • .github/scripts/check-*.sh: all pass

Real machine

macOS:

  • The CLI and engine run against the local mock server, as in these tests.
  • The validator run directly (node scripts/internal/validate-endpoint.mjs <url>).
  • connectedBinding called on an age-v1 binding to http://agmsg.example:8787.

Each gave the refusal text above.

…very team

connect --e2ee skipped the plaintext-address rule and the sync engine exempted every age-v1 binding (#1019), while pull and set-endpoint applied it, so the same address was accepted or refused depending on the command. The rule now decides by the address alone, before any request, for every command and every team: https://, or http:// to a local, LAN or Tailscale address (loopback, RFC1918, ULA, link-local, 100.64/10, *.ts.net). Sealed message bodies do not cover the team id, the endpoint path or the sync metadata, which plaintext http to an internet address exposes on the way.

The refusal no longer offers --e2ee as a way past the rule and says it applies to encrypted teams too. A binding recorded under the old exemption is refused by the engine with that reason and the set-endpoint command that moves it.

Refs #2067
…with the reason and the way out

A binding the earlier age-v1 exemption let connect record: sync start fails, remote status shows the refusal and the set-endpoint command, and set-endpoint to an accepted address succeeds.
@fujibee
fujibee force-pushed the fix/e2ee-endpoint-pull-set-endpoint branch from ea82b34 to b4e6172 Compare November 29, 2026 15:50
@fujibee fujibee changed the title remote: an age-v1 team may be pulled from, or moved to, an address the plaintext rule refuses remote: decide the plaintext-address rule by the address alone, for every team Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant