fix(security): include webhook endpoint secrets in encryption key rotation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 77/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- next.js, typescript
- Domain
- backend, documentation, security, testing
Research direction
Start with src/lib/crypto/rotation.ts and its tests; trace how the existing sealed tables are read, re-encrypted, and counted, then inspect webhookEndpointSecretAad in src/lib/data/webhook-endpoints.ts. Add coverage for rotating an endpoint secret and delivering with only the new key, and update the Key rotation section of docs/operations/deploy.md to list every sealed table. Done means the rotation counts and re-encrypts endpoint secrets and the documented table list is complete.
Written by the indexing model from the issue text.
Description
Context
Found by the Fable pre-production review on 2026-12-02 (main at cedc1914; every line reference below re-checked on main at cde5aa3b). Source: security and privacy readiness report, new issue 4.
npm run keys:rotate re-encrypts only two tables: sealedTables covers connection_credentials and notification_destination_secrets (src/lib/crypto/rotation.ts:43-111). Per-connection webhook endpoint secrets are sealed with the same key (sealSecret, src/lib/data/webhook-endpoints.ts:107-109) and are not rotated. An unreadable secret logs webhook_endpoint.secret_unreadable and returns null (webhook-endpoints.ts:209-212), which the webhook route answers with 404 (src/lib/webhooks/receive.ts:163-167). The procedure removes the old key once the script reports nothing remaining (docs/operations/deploy.md:294-300).
Impact: after a rotation and removal of the old key, every Polar, Resend, and GitLab per-connection delivery gets 404 and the script output shows nothing wrong; the timeline silently stops receiving those events until each connection's webhook is set up again. After a rotation prompted by a compromise, those secrets stay sealed under the compromised key.
Plan
- Add
webhook_endpointstosealedTables, with the same read, re-encrypt, and count steps as the other two, using its associated data (webhookEndpointSecretAad). - Count it in "remaining", so the script never reports done while an endpoint secret is under an old key.
- List every sealed table in
deploy.md"Key rotation".
Acceptance criteria
-
npm run keys:rotatere-encryptswebhook_endpointssecrets and counts them in "remaining". - A test rotates an endpoint secret, removes the old key, and verifies a delivery under the new key only.
-
deploy.md"Key rotation" lists every sealed table. - Playwright e2e: none needed, no screen changes.
Files and areas
src/lib/crypto/rotation.ts, its tests, docs/operations/deploy.md (Key rotation).
Non-goals: rotating other secrets, the incident runbook (separate issue).
Verification
npm run typecheck, npm run lint, npx vitest run src/lib/crypto src/lib/data.
Branch: <issue-number>-rotate-webhook-secrets
Model: anthropic/claude-opus-5-5 | Reasoning effort: unknown
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 2
- Avg merge
- 5h 20m
- Merged PRs (30d)
- 287
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eddiejaoude/StackDash
-
area: integrations documentation priority: P2 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eddiejaoude/StackDash#798 ·
Maintainers usually reply within 1 day
-
area: ops documentation priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
eddiejaoude/StackDash#796 ·
Maintainers usually reply within 1 day
-
area: docs documentation impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#790 ·
Maintainers usually reply within 1 day
-
area: ops bug impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
eddiejaoude/StackDash#785 ·
Maintainers usually reply within 1 day
-
area: connections enhancement impact: low priority: P3 size: XS
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
eddiejaoude/StackDash#768 ·
Maintainers usually reply within 1 day
All issues in eddiejaoude/StackDash
Similar issues
-
bot:ai-assisted component:midnight-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midnightntwrk/midnight-js#1790 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:vscode bug has repro platform:macos platform:vscode regression
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
anthropics/claude-code#113502 ·
-
Add: Rajdhani TV HDOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
effort/l priority/p1 risk/high triage/core
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
iflytek/skillhub#1188 · 1 comment ·
Maintainers usually reply within 1 day