Skip to content
Business logic Write-up Beginner

How i was able to exploit a vulnerable payment system.

An unauthenticated endpoint that credits a user's wallet balance accepted arbitrary user_id and amount values without verifying payment with the gateway. An attacker could repeatedly call it to inflate their own balance or credit another user's wallet.

medium.com

Published on medium.com

Hello hackers and security enthusiasts, we are here again to serve you dinner in a 5-star hotel 😊. Hope you enjoy it !!!.

Moratadave, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The backend trusted client-supplied user_id and amount on a top-up endpoint without authenticating the caller or verifying the payment with the gateway, and had no idempotency check.

Impact

An attacker could add arbitrary funds to their own wallet or another user's wallet without paying, and repeat the request to inflate balances.

What the attacker needed

Network access to the endpoint; no account needed for the endpoint itself

The fix

The endpoint should authenticate the caller, verify the transaction with the payment gateway server-side, and enforce idempotency so each payment is processed once.

How it was found

  1. Observe the top-up request sent after a successful payment.
  2. Replay the same request repeatedly using an intercepting proxy.
  3. Observe the wallet balance increasing each time.
  4. Change the user_id value to credit a different account.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A wallet top-up endpoint is supposed to be called only by the payment provider after a real payment. Here anyone could call it directly and say 'add money to this account', and the server believed it. That means free money in the wallet, and because user IDs are simple numbers, also money in other people's wallets.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.