Skip to content

Fix CSP-ENFORCE: enforce CSP, X-Frame-Options DENY, tighten signup rate-limit#230

Open
bmoss2015 wants to merge 1 commit into
mainfrom
fix/security-csp-and-ratelimit
Open

Fix CSP-ENFORCE: enforce CSP, X-Frame-Options DENY, tighten signup rate-limit#230
bmoss2015 wants to merge 1 commit into
mainfrom
fix/security-csp-and-ratelimit

Conversation

@bmoss2015

Copy link
Copy Markdown
Owner

Summary

  • Switches CSP from Report-Only to enforced
  • Drops unsafe-eval; adds Sentry, PostHog, Lob, Resend, cdnjs to allowlist
  • frame-ancestors 'none' + X-Frame-Options: DENY (was SAMEORIGIN)
  • upgrade-insecure-requests
  • Signup attempt cap 10/min -> 5/min per pre-launch spec

Inline scripts still allowed because Next 16 RSC bootstrap requires them; nonce migration is a future hardening pass.

Test plan

  • Visit preview, verify portal loads (sidebar, dashboard, Stripe checkout, Settings) with no CSP console errors
  • Hit Stripe Checkout flow and confirm js.stripe.com / checkout.stripe.com still load
  • Confirm /login, /signup render and the Sign In As Tester button works on preview
  • Login: info@mossyland.com / Anderson1028!$

…ate-limit

- next.config.ts: switch Content-Security-Policy from Report-Only to
  enforced. Drop unsafe-eval. Add Sentry browser SDK, PostHog
  (us.i.posthog.com / us-assets), Lob API, Resend API, and cdnjs to the
  allowlist. frame-ancestors 'none' + X-Frame-Options DENY (was
  SAMEORIGIN); the portal should never be iframed. Add
  upgrade-insecure-requests. Inline scripts still allowed (Next 16 RSC
  bootstrap), nonce-based pass is a future hardening step.
- signup/_actions.ts: signup attempt cap 10/min -> 5/min per pre-launch
  rate-limit spec. Login (10/min), reset (10/min), stripe webhook
  (100/min) unchanged.
- CHANGELOG.md + pending-living-doc-updates.txt updated.
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moss-equity-portal Ready Ready Preview, Comment Jun 26, 2026 9:04pm

Request Review

@supabase

supabase Bot commented Jun 26, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project rsdmyydyhqgkkvwlklif because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

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.

1 participant