Skip to content

fix(billing): enforce invoice ownership for payment-method pay#2

Open
FR-MaximeDev wants to merge 1 commit intomasterfrom
codex/propose-fix-for-payment-method-pay-endpoint
Open

fix(billing): enforce invoice ownership for payment-method pay#2
FR-MaximeDev wants to merge 1 commit intomasterfrom
codex/propose-fix-for-payment-method-pay-endpoint

Conversation

@FR-MaximeDev
Copy link
Copy Markdown
Owner

Motivation

  • Prevent an IDOR where the pay endpoint could charge another customer's stored payment method because it used the route-bound Invoice without verifying ownership.

Description

  • Add an authorization guard abort_if($invoice->customer_id != auth()->id(), 404); at the start of PaymentMethodController::pay to require the authenticated user own the invoice before attempting to charge its payment method.

Testing

  • Ran php -l app/Http/Controllers/Front/Billing/PaymentMethodController.php which reported no syntax errors.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant