Skip to content

Fix credit APIs to use authenticated user#32

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

Fix credit APIs to use authenticated user#32
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-inspection-c057

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 6, 2026

Summary

  • Stop trusting caller-supplied userId values in credits-related API routes
  • Derive credit reads and deductions from the authenticated GitHub session user
  • Update the credits display client to call the summary endpoint without exposing a user id query parameter

Bug and impact

A caller could provide another user's UUID to credits endpoints and read that user's credit balance or cause analysis/scaffold credit deductions against that account.

Root cause

The credits system accepted userId from request bodies/query strings instead of binding operations to getCurrentUser().

Validation

  • Committed and pushed to cursor/critical-bug-inspection-c057
  • Attempted npx tsc --noEmit and pnpm lint, but this environment has no Node tooling on PATH (node, npm, npx, and pnpm all returned command not found).
Open in Web View Automation 

Co-authored-by: Cole Collins <DealPatrol@users.noreply.github.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 6, 2026

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

Project Deployment Actions Updated (UTC)
repo-app-architect Error Error May 6, 2026 11:05am
v0-repo-app-architect Error Error Open in v0 May 6, 2026 11:05am

Request Review

@supabase
Copy link
Copy Markdown

supabase Bot commented May 6, 2026

This pull request has been ignored for the connected project bpjftwoiosftvjvxpovz 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