Repository navigation
Conversation
…es 0.3) Two confirmed sign-ins racing with different invite cookies could both pass the invitedBy() pre-check, both redeem, and both pay. affiliates 0.3 claims atomically (aff_claim_invite + unique index aff_invites_one_per_user), so the bonus now rests on redeemInvite's result alone: already_invited pays nothing and leaves the second invite unused. Migration 019 is the module's supabase-0.3.0-upgrade.sql (applied to prod by hand, 0 legacy duplicates). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThreatCrush Security Scan12 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 4 | LOW: 6
Snippets are redacted; ThreatCrush never prints matched credential material. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
What
@profullstack/affiliatesto^0.3.0: an account can redeem ONE invite, enforced atomically in Postgres (aff_claim_invite()+ unique indexaff_invites_one_per_user), new reasonalready_invited.acceptInvitedrops its racyinvitedBy()pre-check; the bonus is paid only onredeemInvite(...).ok. A second invite (sequential or concurrent) getsalready_invited, pays nothing and stays unused.supabase/migrations/019_affiliates_0_3.sql= the module'ssupabase-0.3.0-upgrade.sql.Why
Exposure audit: two simultaneous confirmed sign-ins with different invite cookies could both redeem and both pay.
DB
Applied to prod by hand before merge (backup
smshub-aff-pre03-20261026T180832Z.dump),NOTIFY pgrst. Legacy duplicates (legacy_dup = 1): none.🤖 Generated with Claude Code