Skip to content

Fix unauthenticated community connections IDOR - #61

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-be2e
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-be2e

Conversation

@cursor

@cursor cursor Bot commented Aug 28, 2026

Copy link
Copy Markdown

What changed

  • Require a Firebase ID token for community connection GET, POST, and PATCH so callers cannot read or mutate another user’s connection graph.
  • Bind userId / fromUserId to the authenticated uid (resolveOwnedUserId); mismatch returns 403.
  • Send Authorization: Bearer from the community page via fetchWithFirebaseAuthRequired.

Why this change is safe

Verification

  • ESLint on touched files (0 errors; pre-existing warnings only)
  • pnpm test — 70 suites / 390 tests, including 9 new connections auth tests
  • pnpm run security passed
  • Live curl against localhost:3000: unauthenticated GET/POST/PATCH all return 401 {"error":"Unauthorized"}
  • Playwright smoke not run: no unauthenticated E2E covers signed-in community connections

Regression prevention

  • tests/integration/community-connections-auth.test.ts fails before this change (401 missing token, 403 uid mismatch, 200 owner path for GET/POST/PATCH)
  • Community members/discussions list fetches remain public; only connections require a matching token

Release checklist (solo-friendly)

  • CI is green (CI / Lint + Jest, CI / Playwright smoke)
  • Ready to merge to main
  • Post-merge: signed-in user can still list, send, accept, and decline their own connection requests on /community
Open in Web View Automation 

Unauthenticated callers could read private connection messages, send
requests as any userId, and accept/decline as any recipient. Bind
GET/POST/PATCH to the Firebase ID token and send Bearer from the
community page.

Co-authored-by: Andy Oliver Rozario <andyrozario7@gmail.com>
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
future-seer Ready Ready Preview Aug 28, 2026 11:26am

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