Fix missing session ownership and round-active checks in transaction confirm endpoint#4
Draft
Fix missing session ownership and round-active checks in transaction confirm endpoint#4
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ctive in confirm endpoint Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback on sessions API, DB lib, and UI fixes
Fix missing session ownership and round-active checks in transaction confirm endpoint
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
PUT /api/sessions/[id]/transactions/[transactionId]/confirmendpoint never validated that the transaction belonged to the session in the URL, allowing any validtransactionIdto be confirmed/rejected regardless of session context. Additionally, there was no guard against confirming transactions on ended rounds.Changes
tx.session_id === params.id. Returns404(not403) to avoid leaking cross-session transaction existence.roundstable and reject with400 Round is not activeif the round has ended or doesn't exist — preventing mutations after round close.Both checks are applied before the existing
partner_idauthorization check.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.