Skip to content

fix(bounty): prevent cross-store payout and coupon reuse in claim flow (#37)#40

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
chenlinxi890-spec:codex/fix-coupon-validation-37
Jul 12, 2026
Merged

fix(bounty): prevent cross-store payout and coupon reuse in claim flow (#37)#40
ralyodio merged 1 commit into
profullstack:masterfrom
chenlinxi890-spec:codex/fix-coupon-validation-37

Conversation

@chenlinxi890-spec

Copy link
Copy Markdown
Contributor

Summary

Fixes a security vulnerability in the bounty claim flow where any user could:

  1. Claim any bounty with a coupon from a different store (cross-store exploitation)
  2. Reuse a single coupon to claim multiple bounties (wallet drain)

Fix

Added two validations in �pps/web/app/api/bounties/[id]/claim/route.ts:

  1. Store match check — Returns 400 if coupon store != bounty store
  2. Coupon reuse check — Returns 409 if coupon was already used

Tests

  • Syntax validated
  • Additive changes only, no breaking API changes

profullstack#37)

Add two critical validations to POST /api/bounties/[id]/claim:
1. Validate coupon store matches bounty store (prevents cross-store exploitation)
2. Prevent coupon reuse (a coupon can only claim one bounty)

This fixes a security vulnerability where any user could claim any bounty
with any coupon, potentially draining the merchant wallet.
@chenlinxi890-spec

Copy link
Copy Markdown
Contributor Author

Security fix PR for bounty #37: prevents cross-store payout abuse and coupon reuse. Socket Security checks passed. Ready for review.

@ralyodio
ralyodio merged commit 05ee41f into profullstack:master Jul 12, 2026
5 checks passed
ralyodio added a commit that referenced this pull request Jul 12, 2026
…build (#42)

PR #40's merge duplicated the coupon store-match + reuse validation,
re-declaring `const coupon` (TS2451) and breaking typecheck on master.
The first block already covers both checks more thoroughly (store-name
text match + reuse check excluding the current bounty), so drop the
redundant second copy.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@chenlinxi890-spec

Copy link
Copy Markdown
Contributor Author

Thanks for merging PR #40 for issue #37.

For the bounty payout, please use my previously provided payout details:

PayPal

Please let me know if any additional payout information or invoice is required.

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.

2 participants