PRIVACY + SECURITY - Per-user calendar subscription tokens, never rendered on public pages

Problem:

TroopTrack issues one ICS subscription token per unit. That token is a bearer credential: anyone holding the URL can read the unit’s full calendar without logging in. Two design choices make that dangerous in practice. First, the token has been rendered on the unit’s public calendar page, where any visitor could copy it. Second, because it is shared by the whole unit, it cannot be revoked for one person; a single forwarded email, screenshot, or copied link compromises it for everyone, and the only remedy is a unit-wide reset that breaks every member’s calendar at once. Members also hand the shared link to third-party calendar services of their own choosing, which widens the exposure further. The admin UI compounds this by presenting the URL as a link to “share with members,” with no indication on that page that it is senstive information and should be kept secret.

Proposal:

Suggested Phase 1, immediate, small:

1. Never render a subscription URL, in any form, on any page reachable without authentication. If the public calendar page is enabled, it shows events only, no feed links. This is a template and permission-scope change, not a data model change.

2. Change the admin and member UI copy text to treat the URL as a credential: “This link works without a login. Treat it like a password. Do not post it publicly.”

3. Show subscription URLs only inside the authenticated experience, on the calendar or account page of the signed-in user.

Suggested Phase 2, a more durable fix:

  1. Scope subscription tokens per user, not per unit. Data model: an icalendar_subscriptions record with user_id, unit_id, a high-entropy token (at least 128 bits, URL-safe), created_at, last_accessed_at, and revoked_at; store a hash of the token, not the token itself, and look up by hash on each feed request.

  2. Each user sees only their own subscription URL when signed in, and can regenerate or revoke it themselves (if enabled sitewide) without affecting anyone else. Unit admins can revoke any member’s token from the member’s record, and can see last-accessed times for audit.

  3. Feed requests authenticate by token alone, as today, so calendar apps keep working unchanged. No expiry: calendar clients poll indefinitely, so expiring URLs would break the feature; revocation is the control.

Migration: keep existing unit-level tokens working, label them “legacy unit link” in the admin view with the new warning copy, and let units retire them on their own schedule. Default all newly generated links to per-user.

Suggested Acceptance criteria

  • An unauthenticated request to any public unit page returns HTML containing no subscription URL and no token.
  • Two members of the same unit receive different subscription URLs.
  • Revoking one member’s token returns 404 for that URL and leaves every other member’s feed working.
  • A member’s subscription URL appears nowhere in the product except that member’s signed-in pages.
  • Feed access updates last_accessed_at for the token used.

Alternatives considered
A warning label on the existing shared token is not sufficient: shared secrets leak through ordinary member behavior, and there is no per-person remedy when they do. Signed, expiring URLs would fit a download, not a calendar subscription that clients poll for years. Per-user tokens keep the exact client behavior that makes subscriptions useful, while making compromise containable and auditable.

I sincerely hope this suggestion can make this software more secure and safe, protecting our youth and sensitive information about where and when they meet.