trails/apps/journal
Ullrich Schäfer 769d1b5d31
security: log redaction, magic-link enumeration, federation doc cap
Three Low/Info hardening items from the 2026-06-10 security review.

OAuth/credential log redaction:
- oauth-flow.server.ts logged the raw exception on code-exchange
  failure; a provider error can embed the auth code / token response,
  which would land in logs + Sentry. Log only e.message now.
- manager.markNeedsRelink bounded the provider-supplied reason string
  to 200 chars before logging.

Magic-link account enumeration:
- createMagicToken now returns null (instead of throwing "No account
  found for this email") when no account matches; the login route
  always responds { step: "magic-link-sent" }, minting a token and
  sending mail only for a real account. The public login form can no
  longer be used to probe which emails are registered. Registration's
  email/username "already in use/taken" messages are intentionally
  unchanged — standard signup UX, and the passkey ceremony can't be
  made to fake-succeed.

Federation remote-document size cap:
- assertRemoteDocSize rejects an actor/outbox document over 4 MB once
  serialized, applied in the ingest fetchJson seam. Fedify owns the
  transfer (with its own SSRF + redirect limits) and our poll uses the
  authenticated loader for secure-mode instances, so this is a
  downstream guard on iteration/persistence, complementing the existing
  per-poll item cap.

Tests: assertRemoteDocSize unit cases; a gated (FEDERATION_INTEGRATION=1)
integration test asserting an unsigned POST to /users/:u/inbox is
rejected with 401 — a regression guard for Fedify's signature
verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 07:52:34 +02:00
..
app security: log redaction, magic-link enumeration, federation doc cap 2026-06-11 07:52:34 +02:00
public Add favicons, apple-touch-icons, and Chrome DevTools JSON 2026-03-29 10:35:03 +02:00
.env.example feat(journal): Garmin activity import — provider, webhook pipeline, backfill (§1–5) 2026-06-07 17:47:22 +02:00
Dockerfile remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
package.json remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
react-router.config.ts feat(journal): Fedify spike — WebFinger + actor objects behind FEDERATION_ENABLED 2026-06-06 14:15:27 +02:00
server.ts journal: typed job seam + Komoot credentials through the manager 2026-06-10 02:05:24 +02:00
tsconfig.json Fix planner production server + use .ts extensions everywhere 2026-03-25 01:41:33 +01:00
vite.config.ts Pre-warm Vite dep discovery for the journal dev server 2026-04-26 19:51:39 +02:00
vitest.config.ts Add mocked unit tests for REST API route handlers 2026-04-13 00:59:45 +02:00