Skip to content
Business logic Write-up Beginner

How a Failed Payment Turned Into a Successful Order

The payment verification endpoint accepted a client-supplied Base64-encoded JSON status parameter, allowing an attacker to change a failed transaction into a successful one. This enabled placing orders without actual payment.

medium.com

Published on medium.com

You select a product, proceed to checkout, choose a payment method, and complete the transaction through a trusted payment gateway. Everything feels locked down and reliable.

Ankitsingh, 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 application trusted client-supplied payment status data instead of verifying the transaction server-side with the payment gateway.

Impact

An attacker could place orders without paying, manipulate transaction states, bypass payment validation, abuse inventory systems, and cause financial loss to the platform.

What the attacker needed

A user account on the e-commerce platform; ability to intercept and modify HTTP requests

The fix

The application should verify every transaction server-side using trusted gateway APIs, signatures, hashes, or secure callbacks, and never trust client-supplied payment status.

How it was found

  1. Add a high-value product to the cart and proceed to payment using UPI.
  2. On the third-party payment gateway page, click the Back button to cancel the transaction.
  3. Monitor network traffic after cancellation and identify the payment verification request.
  4. Decode the Base64-encoded status parameter to reveal JSON with failure status.
  5. Modify the JSON to set status and serviceStatus to success, then re-encode and replace the parameter.
  6. Forward the modified request; the order is marked as successfully paid.

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.

When you pay online, the website should check with the payment provider (like a bank) to confirm the money arrived. Here, the website instead trusted a piece of data sent by your browser that said 'payment successful'. A malicious user could edit that data to say 'success' even if they never paid, and the site would treat the order as paid.

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.