Skip to content

Security findings L2, L4, L6, L7: secret checks, pinned actions, own salt, secret from Vault - #57

Merged
nicolasmesser merged 1 commit into
mainfrom
claude/project-thread-vpgvb6
Nov 29, 2026
Merged

nicolasmesser merged 1 commit into
mainfrom
claude/project-thread-vpgvb6

Conversation

@nicolasmesser

Copy link
Copy Markdown
Member

Low-severity findings from the security review, bundled. L3 is left to Dependabot (astro-compress 2.4.4 ships the fixed dependencies), and L5 is a Netlify setting.

Changes

  • L2: notify-submission compares the webhook secret in constant time (secret.ts, with a test). The body-size limit from the review was dropped: the body is only read after the secret check passes.
  • L4: actions/checkout and actions/setup-node are pinned to commit hashes (v7.0.1, v7.1.0). Dependabot's monthly github-actions update keeps them current.
  • L6: the events rate limit salts visitor hashes with a new RATE_LIMIT_SALT secret instead of the service role key. Switching resets the per-visitor counters once.
  • L7: migration 20261129010000_webhook_secret_from_vault.sql replaces the dashboard webhook on event_submissions with a trigger function. The function reads notify_webhook_secret from Vault and sends the same payload (type, table, schema, record, old_record). The trigger no longer appears under Database Webhooks in the dashboard.

Rollout

Done by Claude after merge, in this order:

  1. Create the RATE_LIMIT_SALT Edge Function secret (random).
  2. Deploy events and notify-submission.
  3. Apply the L7 migration.

Testing

  • deno test supabase/functions: 9 passed.
  • L7 migration on a local Postgres 16, with mocked net.http_post and Vault:
    • an insert and an update each send the Vault secret and the expected payload;
    • anon can't execute the function.
  • After rollout: one test submission on the live site, to confirm the review email still arrives.

Generated by Claude Code

…salt, secret from Vault

- L2: notify-submission compares the webhook secret in constant time.
- L4: GitHub Actions pinned to commit hashes; Dependabot keeps them current.
- L6: the events rate limit salts visitor hashes with its own RATE_LIMIT_SALT
  secret instead of the service role key.
- L7: the event_submissions webhook trigger reads its secret from Vault
  instead of keeping it in the trigger definition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BtKM4TZ917FEo7VwVUDwjU
@netlify

netlify Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for swim-events ready!

Name Link
🔨 Latest commit d974213
🔍 Latest deploy log https://app.netlify.com/projects/swim-events/deploys/6b0c52b1e4c2790c4869c2fa
😎 Deploy Preview https://deploy-preview-57--swim-events.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@nicolasmesser
nicolasmesser merged commit 2ae387c into main Nov 29, 2026
5 checks passed
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.

2 participants