tailshare: do not persist Tailscale auth keys by default #190

Closed
opened 2026-08-14 19:13:29 +02:00 by codinget · 1 comment
Owner

Problem

Tailshare includes authKey in TailshareConfig and serializes that whole object under tailshare:config in localStorage. A Tailscale auth key is an enrollment credential. Persisting it with ordinary preferences makes it available to every same-origin script and retains it after the registration flow no longer needs it.

Persistent node identity is a separate feature: retaining node state must not imply retaining the credential that originally enrolled the node.

Direction

  • separate credential state from persisted Tailshare preferences;
  • keep auth keys in memory or session scope by default;
  • discard the key after successful registration where the lifecycle permits it;
  • migrate existing tailshare:config values by removing any persisted authKey;
  • cover both main-thread and SharedWorker initialization without placing the raw key in observable configuration identities, errors, logs, or events;
  • preserve current diagnostic redaction;
  • if persistent credential storage remains possible, make it an explicit and conspicuous opt-in rather than the default.

Acceptance

  • normal preference persistence and reload contain no auth key;
  • legacy persisted keys are removed safely without losing unrelated settings;
  • main-thread and SharedWorker registration still work;
  • initialization failure and fallback do not re-persist or expose the key;
  • logout/reset and successful registration clear credential state as documented;
  • tests cover migration, reload, success, failure, fallback, redaction, and reset.

Related

  • #91 owns persistent non-ephemeral node identity and must keep node state distinct from enrollment credentials;
  • #127, completed by PR #167, established secret-safe worker configuration identities;
  • #168 owns deliberate worker reconfiguration.
## Problem Tailshare includes `authKey` in `TailshareConfig` and serializes that whole object under `tailshare:config` in `localStorage`. A Tailscale auth key is an enrollment credential. Persisting it with ordinary preferences makes it available to every same-origin script and retains it after the registration flow no longer needs it. Persistent node identity is a separate feature: retaining node state must not imply retaining the credential that originally enrolled the node. ## Direction - separate credential state from persisted Tailshare preferences; - keep auth keys in memory or session scope by default; - discard the key after successful registration where the lifecycle permits it; - migrate existing `tailshare:config` values by removing any persisted `authKey`; - cover both main-thread and SharedWorker initialization without placing the raw key in observable configuration identities, errors, logs, or events; - preserve current diagnostic redaction; - if persistent credential storage remains possible, make it an explicit and conspicuous opt-in rather than the default. ## Acceptance - normal preference persistence and reload contain no auth key; - legacy persisted keys are removed safely without losing unrelated settings; - main-thread and SharedWorker registration still work; - initialization failure and fallback do not re-persist or expose the key; - logout/reset and successful registration clear credential state as documented; - tests cover migration, reload, success, failure, fallback, redaction, and reset. ## Related - #91 owns persistent non-ephemeral node identity and must keep node state distinct from enrollment credentials; - #127, completed by PR #167, established secret-safe worker configuration identities; - #168 owns deliberate worker reconfiguration.
Author
Owner

migrate existing tailshare:config values by removing any persisted authKey;

The only existing one is mine as this is not published, I'll fix it manually

> migrate existing tailshare:config values by removing any persisted authKey; The only existing one is mine as this is not published, I'll fix it manually
codinget added this to the Tailshare: download one Taildrive file milestone 2026-08-28 01:16:23 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: webnet/webnet#190