fix(nextjs): allow Clerk protection hosts on all ports in connect-src - #9458
fix(nextjs): allow Clerk protection hosts on all ports in connect-src#9458mwickett wants to merge 2 commits into
Conversation
The generated connect-src listed https://*.protect.clerk.com, and a CSP source with no port matches the scheme's default port only. Requests to those hosts on other ports were therefore blocked by the generated policy. Use a port-inclusive source for connect-src. script-src and frame-src are unchanged, as those are only requested on 443.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 2c628d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 631545bbed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // connect-src carries the port wildcard because those hosts are also requested on | ||
| // ports other than 443, which a portless source would not match. |
There was a problem hiding this comment.
Condense the explanation to one line
This new explanation spans two // lines even though the repository requires warranted comments to be a single terse line. Please either remove it—the table already makes the directive-specific difference explicit—or condense it to one line to comply with the documented comment policy.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe default Next.js CSP now allows connections to Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized CSP fix broadens Clerk protection-host connectivity to supported ports without changing script or frame loading behavior, and no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Description
The
contentSecurityPolicyoption generated aconnect-srclistinghttps://*.protect.clerk.com. A CSP source expression with no port matches the scheme's default port only, so requests to Clerk's abuse and fraud protection hosts on any other port were blocked by the generated policy — surfacing asconnect-srcviolations in applications that enable the option.connect-srcnow uses a port-inclusive source.script-srcandframe-srcare deliberately unchanged, as those hosts are only requested on 443.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change