Skip to content

[comp] Production Deploy#2372

Merged
Marfuen merged 2 commits intoreleasefrom
main
Mar 25, 2026
Merged

[comp] Production Deploy#2372
Marfuen merged 2 commits intoreleasefrom
main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.

github-actions bot and others added 2 commits March 25, 2026 00:00
Custom domain trust portals (e.g. trust.sessionlab.com) failed with
CORS errors on client-side API calls. The page loaded fine via SSR
but form submissions like "Request Access" failed with "Failed to fetch".

Root cause: getCustomDomains() filtered by domainVerified=true, but
that flag only gets set when an admin completes our DNS check flow.
Vercel can serve the domain before that, so the portal works but
CORS rejects the origin.

- Remove domainVerified filter from CORS domain query — an admin
  adding a domain is sufficient authorization
- Add independent error handling for Redis/DB in getCustomDomains
  so a Redis failure doesn't silently drop valid DB results
- Exempt /v1/trust-access from origin check middleware since those
  endpoints are public (no auth, no cookies, no CSRF risk)

Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 25, 2026

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

Project Deployment Actions Updated (UTC)
comp-framework-editor Ready Ready Preview, Comment Mar 25, 2026 7:11pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app (staging) Skipped Skipped Mar 25, 2026 7:11pm
portal (staging) Skipped Skipped Mar 25, 2026 7:11pm

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 25, 2026

PR Summary

Medium Risk
Changes CORS/origin trust decisions by allowing all published custom domains (not just domainVerified) and exempting /v1/trust-access from origin validation, which could widen request acceptance if misconfigured. Behavior is guarded with additional structural tests and best-effort Redis caching to reduce outage impact.

Overview
Updates dynamic CORS trusted-origin resolution to accept published custom domains immediately (removing the domainVerified constraint) and makes Redis caching best-effort with separate error handling for cache read, DB lookup, and cache write.

Extends originCheckMiddleware to exempt /v1/trust-access from Origin validation, and adds structural tests to enforce these CORS/origin-check behaviors and error-handling expectations.

Written by Cursor Bugbot for commit 0d54899. This will update automatically on new commits. Configure here.

@Marfuen Marfuen merged commit fc9c779 into release Mar 25, 2026
11 of 12 checks passed
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.11.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

'/api/auth', // better-auth handles its own CSRF
'/v1/health', // health check
'/api/docs', // swagger
'/v1/trust-access', // public trust portal endpoints (no auth, no cookies)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSRF exemption too broad, covers authenticated admin endpoints

Medium Severity

The /v1/trust-access prefix exemption from origin validation is too broad. While the public-facing endpoints under this path are indeed unauthenticated, there are multiple admin/* sub-paths (e.g., approve, deny, revoke) protected by HybridAuthGuard that support cookie-based session auth. Exempting them from the origin check removes the CSRF defense-in-depth for these state-changing admin actions. The comment says "no auth, no cookies" but that only applies to non-admin routes.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants