Methodological approach to find business logic bugs
The payment gateway's callback endpoint was protected by IP whitelisting, but the application only validated the order ID and not the payment ID. An attacker could use their own sandbox account to generate a payment link with the victim's order ID and the victim's callback URL, then make a payment, causing the gateway to send a legitimate callback that bypassed the IP whitelist and confirmed the order without proper payment.
Published on strike.sh
As cyberattacks rise everyday, so is the web applications’ security. This leads to two potential problems that developers can’t solve on their own.
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.
Context
Strike was asked to pentest an NFT marketplace, and the customer specifically wanted attention paid to FIAT payments. FIAT here means ordinary currency such as USD or EUR, so the marketplace let users buy NFTs with regular money instead of cryptocurrency.

The marketplace used a private company as its payment gateway. The flow is simple: the seller, in this case the NFT market, generates a payment link and gives it to the user, who pays with a credit card. The gateway's servers then send a request to a callback endpoint hosted by the seller so the seller can confirm the payment completed. The callback is what tells the marketplace that the payment completed.
Setup
The customer provided a test environment that uses the gateway's sandbox, so test credit card numbers could be used and payments made without spending real money.
To protect the callback, the customer whitelisted the payment company's IP addresses, so that no other IP could send a request to the callback endpoint. The researcher tried to bypass the whitelisting and found it properly implemented: it was enforced both in the application and in the WAF, and headers such as X-Forwarded-For did not work either.
The researcher considered forcing the company's servers to send a bogus confirmation, but attacking the company itself was out of scope and not controlled by the customer. To get a full picture of what happens behind the scenes, the researcher registered a sandbox account with the payment company directly. The company publishes API documentation, including a Postman API collection. Using the collection requires setting X-Login, X-Trans-Key and SecretKey in the Postman environment; those values are available when a sandbox account is registered.
Finding it
Inside the Postman collection, the endpoint that generates payment links sits under Payings -> Payments -> Redirect -> 2 Steps Checkout (without payment_method_id). Looking at its JSON parameters, two stood out: order_id and notification_url. The notification_url is the callback endpoint the application uses to confirm successful payments, and order_id is set by the application to correlate the payment with the order.

That pairing suggested the attack: use a sandbox account at the payment company to generate the payment link, put the marketplace's own order value in order_id, point notification_url at the marketplace callback, and pay. The gateway would then contact the marketplace on the attacker's behalf, with the attacker's chosen order id, which bypasses the IP whitelisting because the callback genuinely originates from the company.
Exploitation
Step 1: generate a payment URL with the sandbox account
Using the sandbox credentials from the payment company, a payment link is generated through the 2 Steps Checkout (without payment_method_id) endpoint.
Step 2: set order_id to the marketplace order
The order_id parameter is filled with the value of the attacker's order in the NFT marketplace, so the callback will be correlated with that order.
Step 3: point notification_url at the marketplace callback
The notification_url parameter is set to the callback URL of the NFT marketplace, so the gateway will deliver its confirmation there.
Step 4: perform the payment
The payment is completed. The gateway contacts the NFT marketplace with the chosen order id, effectively bypassing the IP whitelisting.
The researcher tested the scenario, and the developers only checked the order id and did not check the payment id. The payment id is sent by the company when performing the callback, and it is also available when the link is generated in the first place.
Root cause
The callback handler trusted the order id alone. Because the payment id was not checked, an attacker who controls a payment link at the gateway can direct a callback at the marketplace for an order they choose. The IP whitelisting was implemented properly in both the application and the WAF, and X-Forwarded-For spoofing did not work, but it only proves where a request comes from, not that the payment behind it belongs to the order being confirmed.
Impact
The scenario bypassed the IP whitelisting, since the callback came from the company. The scenario allowed full control of the price, and even if the price could not be controlled, the attacker was essentially paying themselves.
Fix
The report does not describe a fix. The payment id is sent with the callback and is also available when the link is generated.
Variants to test
- Callback handlers that trust an order identifier from the payment provider without binding it to a payment identifier. A positive result is a confirmation accepted for an order whose payment id does not match.
- IP whitelisting used as the only control on a payment callback. A positive result is a callback that passes the whitelist but carries attacker-chosen order data.
- Payment provider APIs that let the merchant set both the order reference and the notification URL. A positive result is a link whose callback reaches a third-party endpoint with the merchant's chosen order id.
- Price fields in payment link creation.
Method summary
- Understand the application logic by using the application as a regular user.
- Understand the technical details of the implementation, usually by reading the documentation for the technologies and APIs the target uses.
- Write your own code that uses the same technology or API, to confirm you understood the documentation and to prepare exploitation. While writing it, focus on what could go wrong: consider which checks you would need to prevent attacks, and turn that into a checklist for black box testing.
What happened, in plain words
A security researcher was hired to test an NFT marketplace, a website where people buy and sell NFTs. An NFT is a digital item whose ownership is recorded on a blockchain, and a marketplace is the shop where those items change hands. The customer asked the researcher to pay special attention to one feature: FIAT payments. FIAT is just a fancy word for ordinary money like US dollars or euros, as opposed to cryptocurrency. So the marketplace let people buy NFTs with a normal credit card instead of with crypto.

The marketplace did not handle card payments itself. It used a separate payment company as its payment gateway, meaning a service that takes the card details and moves the money. The flow works like this: the seller (here, the NFT marketplace) creates a payment link and gives it to the buyer, who pays with a credit card. When the payment is done, the payment company's servers send a message to a callback endpoint hosted by the seller. A callback endpoint is simply a web address on the seller's site that is designed to receive automatic messages from another company. That message is how the marketplace learns that the money has arrived.
The callback is what tells the marketplace that the payment completed. The rest of this article walks through how the researcher got there, step by step, and then turns the story into a repeatable method.
Setting up a safe place to experiment
The customer gave the researcher a test environment that uses the payment company's sandbox. A sandbox is a copy of a payment system that behaves like the real one but moves no real money; it accepts special test card numbers. This matters because it lets you try attacks without breaking the law or losing money.
To protect the callback, the customer had whitelisted the payment company's IP addresses. An IP address is the numeric address a computer uses on a network, a bit like a postal address for machines. Whitelisting means only addresses on an approved list are allowed in, so only the payment company's servers could send a message to the callback endpoint. Anyone else trying to send a fake payment confirmation would be turned away.
The researcher tried hard to get around this whitelist and found it was done properly. It was enforced in two places: in the application itself and in the WAF. A WAF, or web application firewall, is a filter that sits in front of a website and blocks suspicious traffic before it reaches the site. The researcher also tried sending headers such as X-Forwarded-For. A header is a small piece of extra information a browser or server attaches to a request, and X-Forwarded-For is a header that is supposed to say which address a request originally came from. Some badly built sites believe that header and treat the request as coming from the address written in it. Here it did not work.
It seemed like the only solution was to make the payment company's own servers send a bogus confirmation. But that had to be done without attacking the payment company itself, because that company was out of scope and not controlled by the customer, so testing it would have been illegal.
Feeling stuck, the researcher did something simple and clever: registered a sandbox account with the payment company directly. Having your own account on the other side lets you see how the service really behaves, and it opens the possibility of abusing the service's own logic instead of breaking through the whitelist.
The payment company publishes API documentation, including a Postman API collection. An API is the set of addresses and rules one program uses to talk to another; think of it as a menu of requests a service accepts. Postman is a free tool for sending those requests by hand, without writing a program. A collection is a ready-made folder of example requests that the company provides so developers can try its API quickly.
To use the requests in the collection, three values had to be filled into the Postman environment: X-Login, X-Trans-Key and SecretKey. These are credentials, pieces of text that prove who you are, much like a username and password. The payment company gives them to you when you register a sandbox account. The Postman environment is just a place to store such values so every request in the collection can use them automatically.
Finding the interesting endpoint
Inside the collection, the endpoint that generates payment links is filed under Payings -> Payments -> Redirect -> 2 Steps Checkout (without payment_method_id). An endpoint is one specific address in an API that does one specific job; the path above is just the folder structure inside Postman.
Looking at the JSON parameters for that endpoint, two stood out: order_id and notification_url. JSON is a common text format for structured data, and parameters are the named values you send with a request. The notification_url is the callback endpoint the application uses to confirm successful payments, and order_id is set by the application to link the payment to the order.

Seeing those two together was the turning point. The payment company lets the merchant choose both which order the payment refers to and where the confirmation should be sent. That suggested the attack: use a sandbox account at the payment company to generate the payment link, put the marketplace's own order value in order_id, point notification_url at the marketplace callback, and pay. The gateway would then contact the marketplace on the attacker's behalf, with the attacker's chosen order id. The whitelist would not stop it, because the callback genuinely comes from the payment company's servers.
Carrying out the attack
Step 1: generate a payment URL with the sandbox account
Using the sandbox credentials from the payment company, a payment link is generated through the 2 Steps Checkout (without payment_method_id) endpoint. The reason for this step is that the attacker needs a real payment session at the gateway, one they control, so that the gateway has a reason to send a confirmation later.
Step 2: set order_id to the marketplace order
The order_id parameter is filled with the value of the attacker's order in the NFT marketplace, so the callback will be linked to that order. In plain terms, the attacker tells the payment company "this payment is for order X", where X is the order they want to receive for free.
Step 3: point notification_url at the marketplace callback
The notification_url parameter is set to the callback URL of the NFT marketplace, so the gateway will deliver its confirmation there. This is the heart of the trick: the attacker is choosing where the payment company sends its "payment complete" message.
Step 4: perform the payment
The payment is completed. The gateway contacts the NFT marketplace with the chosen order id, effectively bypassing the IP whitelisting. The marketplace sees a message coming from the payment company's real address, so the whitelist is satisfied, and it sees the order id it expects.
The researcher tested the scenario, and the developers only checked the order id and did not check the payment id. The payment id is a separate identifier for the payment itself, sent by the company when performing the callback, and it is also available when the link is generated in the first place. Because the payment id was not checked, the marketplace could not tell that the payment behind the confirmation did not match the order.
Why it worked
The callback handler trusted the order id alone. Because the payment id was not checked, an attacker who controls a payment link at the gateway can direct a callback at the marketplace for an order they choose. The IP whitelisting was implemented properly in both the application and the WAF, and X-Forwarded-For spoofing did not work, but it only proves where a request comes from, not that the payment behind it belongs to the order being confirmed. In everyday terms: the bouncer checked that the messenger really worked for the bank, but never checked that the letter inside was about the right purchase.
What the attacker gains
The scenario bypassed the IP whitelisting, since the callback came from the company. The scenario allowed full control of the price, and even if the price could not be controlled, the attacker was essentially paying themselves.
How to fix it
The report does not describe a fix. The payment id is sent with the callback and is also available when the link is generated.
Similar things to test elsewhere
- Callback handlers that trust an order identifier from the payment provider without binding it to a payment identifier. A positive result is a confirmation accepted for an order whose payment id does not match.
- IP whitelisting used as the only control on a payment callback. A positive result is a callback that passes the whitelist but carries attacker-chosen order data.
- Payment provider APIs that let the merchant set both the order reference and the notification URL. A positive result is a link whose callback reaches a third-party endpoint with the merchant's chosen order id.
- Price fields in payment link creation.
A method you can repeat
- Understand the application logic by using the application as a regular user. Click through it, buy something in the test environment, and note what happens at each stage.
- Understand the technical details of the implementation, usually by reading the documentation for the technologies and APIs the target uses. Documentation often reveals options the website's own screens never show.
- Write your own code that uses the same technology or API, to confirm you understood the documentation and to prepare exploitation. While writing it, focus on what could go wrong: consider which checks you would need to prevent attacks, and turn that into a checklist for black box testing. Black box testing means testing without seeing the source code, the way an outside attacker would.
Glossary
- API: the set of addresses and rules one program uses to talk to another, like a menu of requests a service accepts.
- Black box testing: testing a system without access to its source code, as an outside attacker would.
- Callback endpoint: a web address on a seller's site that is designed to receive automatic messages from another company, such as a payment confirmation.
- Collection (Postman): a ready-made folder of example API requests provided by a company so developers can try its API quickly.
- Credentials: pieces of text that prove who you are, such as a username, password, key or token.
- Cryptocurrency: digital money recorded on a blockchain, as opposed to ordinary government-issued money.
- Endpoint: one specific address in an API that does one specific job.
- FIAT: ordinary government-issued currency such as USD or EUR, as opposed to cryptocurrency.
- Header: a small piece of extra information a browser or server attaches to a request.
- IP address: the numeric address a computer uses on a network, like a postal address for machines.
- JSON: a common text format for structured data, used to send named values in requests.
- NFT: a digital item whose ownership is recorded on a blockchain.
- Out of scope: outside the set of systems a tester is authorised to attack.
- Parameter: a named value sent with a request, such as
order_idornotification_url. - Payment gateway: a service that takes card details and moves the money on behalf of a seller.
- Postman: a free tool for sending API requests by hand, without writing a program.
- Sandbox: a copy of a payment system that behaves like the real one but moves no real money.
- Token: a piece of text that stands in for a login or permission, so you do not have to send a password every time.
- WAF (web application firewall): a filter that sits in front of a website and blocks suspicious traffic before it reaches the site.
- Whitelisting: allowing only addresses or values on an approved list, and rejecting everything else.
X-Forwarded-For: a header that is supposed to say which address a request originally came from; some badly built sites trust it and treat the request as coming from that address.