The Bug That Kept On Giving :: PaymentBypass :: Response Manipulation
The payment flow relied on client-side JavaScript to check the server's response for 'Authorised' before showing a confirmation. An attacker could intercept the server's 'Refused' response and change it to 'Authorised', bypassing payment and receiving a gift card confirmation.
Published on crypt0g30rgy.github.io
A story of the third bug i found after the one for QR CODE And the Next Exposed Return URL
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
The target was a website run by a program the researcher refers to as jij0. The site offered an option to buy e-giftcards at https://jij0.be/jij0-gift, which redirected to https://gifts.jij0.be. The gift card checkout is the feature under test: a user adds an item to a cart, fills in their details, selects card payment, enters card details, and the transaction is performed. The site then decides, based on the server's response, whether to send the user to a confirmation page or back to the cart.
The researcher frames this as the third bug found in the same payment flow, after a QR code issue and an exposed return URL. The class of bug here is a payment bypass caused by the client relying on JavaScript to validate transactions.
Setup
The only tool named is Burp Suite, connected to the researcher's preferred browser, with the proxy intercepting traffic. No account details, roles, versions or other preconditions are given beyond being able to reach the gift card site and go through its checkout. The test card used is 1337 1337 1337 1337 with expiry date 03/30.
Finding it
The researcher points at the checkout's client-side payment code. The relevant part is this function:
function makePayment(data) {
data['paymentMethod'] = $('.checkout__payment').html();
$.ajax({
method: "POST",
url: "/v1/Payment",
data: {paymentData: data},
dataType: "JSON",
success: function(response) {
},
error: function () {
alert('Ooops...');
}
}).then(action => {
if (action == "Authorised") {
dropin.setStatus("success")
$.ajax({
method: "POST",
url: "/v1/HandleResponse",
data: {responseData: action},
dataType: "JSON",
success: function(response) {
window.location = response;
},
error: function (response) {
window.location = response;
}
});
} else if (action == "Refused" || action == "Error") {
dropin.setStatus("error");
$.ajax({
method: "POST",
url: "/v1/HandleResponse",
data: {responseData: action},
dataType: "JSON",
success: function(response) {
window.location = response;
},
error: function (response) {
window.location = response;
}
});
The researcher's reading of the snippet is that the developer assumed server responses can be trusted, because a user has no control over what the server returns. With a tool like Burp Suite, however, server responses can be manipulated, so the value compared in action == "Authorised" and the value passed to dropin.setStatus can be controlled by the client.
The flow on gifts.jij0.be is described as: item added to cart, user info filled in and checkout reached, user selects pay with card, user enters card, transaction performed, then gifts.jij0.be checks the server responses. The researcher marks this check as where the issue lies. Depending on the result, the user is redirected to the cart if the transaction failed, or to a confirmation page if it succeeded.
A successful transaction follows this sequence:
GET /v1/cart == POST /v1/Payment == [Response: 200 OK Data:"Authorised"] == POST /v1/HandleResponse == GET /confirmation
An unsuccessful transaction follows this one:
GET /nl/cart == POST /v1/Payment == [Response: 200 OK Data:"Refused"] == POST /nl/checkout/HandleResponse == GET /cart
Exploitation
Step 1: Prepare the proxy
Connect Burp Suite to the browser so that traffic to the site passes through it.
Step 2: Add an item
Go to https://gifts.jij0.be/ and add an item to the cart.
Step 3: Start checkout
Proceed to https://gifts.jij0.be/cart and select checkout.
Step 4: Fill in details
Follow the prompts to fill in all the required details and proceed to the payment page.
Step 5: Enter the test card
Select pay with card and add the test card 1337 1337 1337 1337 with expiry date 03/30.
Step 6: Observe a failed checkout
Check out once for comparison and observe the failed checkout, which redirects to https://gifts.jij0.be/cart.
Step 7: Return to payment
Go to payment again and repeat step 5, but do not send the request yet.
Step 8: Capture the payment request
In Burp, turn intercept on, send the request, and make sure the POST /v1/Payment request is captured.
Step 9: Intercept the response
Right click and select intercept response for this request, then forward the request.
Step 10: Read the refusal
Observe the 200 OK response with the data Refused in the body.
Step 11: Rewrite the response
Change Refused to Authorised and forward the request, then turn intercept off.
Step 12: Confirmation
The researcher states that a confirmation is then received in the mail.

The report was sent to the program and, after a few days, accepted as a high severity with a bounty of €500 awarded.
Root cause
The checkout decides success or failure in the browser. The makePayment function compares the value returned by the payment call against the strings Authorised, Refused and Error, and drives the UI and the follow-up POST /v1/HandleResponse call from that comparison. Because the comparison happens client-side, an attacker who can intercept the response can substitute Authorised for Refused and the client will treat the transaction as approved, call HandleResponse with Authorised, and follow the redirect to the confirmation page.
The report does not describe what the server does with the Authorised value sent to POST /v1/HandleResponse. The developer's assumption that the server response can be trusted is what fails, because the response is what the attacker controls.
Impact
An attacker who can intercept their own traffic can turn a refused card payment into one the site treats as successful, with a confirmation received by mail. The report shows this against the gift card checkout on gifts.jij0.be, with the confirmation arriving by mail. The report does not describe limits such as order value caps, manual review, or whether the confirmation leads to fulfilment; those are not stated.
Fix
Variants to test
- Intercept the payment response on other checkouts and change a failure value to a success value. A positive result is the client proceeding to a confirmation page or equivalent success state.
- Look for client-side comparisons of payment status strings in JavaScript, such as
Authorised,Refused,Error,successorfailed. A positive result is a branch that changes UI state or triggers a follow-up request based only on that value. - Check whether the follow-up handler endpoint, here
POST /v1/HandleResponse, accepts a client-supplied status and acts on it. A positive result is the server returning a confirmation redirect for a status the client supplied. - Replay a successful response against a new order or a different cart. A positive result is a confirmation for an order that was never paid.
- Test the same manipulation on the failure path, for example changing
ErrortoAuthorised, to see whether every branch is equally exposed. A positive result is any branch that can be flipped to success.
What happened, in plain words
A researcher found a way to make an online gift card shop believe a payment had gone through when it had actually been refused. The shop's website decided whether a payment succeeded by reading a message sent back from its own server, and that message travelled through the customer's browser. By using a tool that lets you pause and edit traffic between the browser and the server, the researcher changed the word "Refused" to "Authorised" on its way back. The website then treated the order as successful and a confirmation was received in the mail.
The report was sent to the bug bounty program, accepted as high severity, and paid a bounty of €500.
This article walks through the whole thing from scratch. You do not need any security background to follow it. Every technical term is explained the first time it appears, and there is a glossary at the end.
The background: what the site does
The target was a website run by a program the researcher calls jij0. The site offered an option to buy e-giftcards at https://jij0.be/jij0-gift, which redirected to https://gifts.jij0.be. An e-giftcard is a digital voucher you buy online and send to someone; it has a code that can be redeemed for goods or credit.
The gift card checkout is the feature under test. Here is the normal journey a customer takes:
- Add an item to a cart.
- Fill in personal details (name, address, and so on).
- Select card payment.
- Enter card details.
- The transaction is performed.
- The site looks at the server's response and decides whether to send the user to a confirmation page or back to the cart.
That last step is the heart of the story. The site asks its own server "did the payment work?" and then acts on the answer. The problem is where it asks and who can see the answer.
This was the third bug the researcher found in the same payment flow, after a QR code issue and an exposed return URL. The class of bug here is a payment bypass: making a system believe a payment succeeded when it did not. The specific cause is that the site relied on JavaScript running in the browser to validate transactions.
A few concepts before we start
Before diving into the code, here are the ideas you need. Each one is used later, so keep them in mind.
- Server and client. The server is the computer owned by the shop that stores data and makes decisions. The client is your browser, running on your computer. They talk to each other over the internet.
- HTTP request and response. When your browser wants something from a server, it sends a request (for example, "here is my payment information, please process it"). The server sends back a response (for example, "the payment was refused"). Think of it like posting a letter and getting a reply.
- API. An API (Application Programming Interface) is a set of addresses on a server that programs talk to. Instead of a human clicking buttons, the browser's JavaScript sends requests to these addresses and gets structured answers back. The addresses in this report, like
/v1/Payment, are API endpoints. - Endpoint. A specific address on the server that does one job.
/v1/Paymenthandles payments;/v1/HandleResponsehandles the follow-up after a payment result comes back. - JavaScript. The programming language that runs inside your browser. It makes pages interactive: it can send requests to the server, change what you see, and redirect you to another page.
- AJAX. A technique where JavaScript sends a request to the server in the background, without reloading the page. The
$.ajax(...)calls in the code below are AJAX calls. - JSON. A text format for structured data, like
{"status": "Authorised"}. Servers and browsers use it to exchange information. - Proxy. A tool that sits between your browser and the server and lets you see, pause, and edit the traffic going both ways. Burp Suite is a popular proxy used by security researchers. Think of it as a postal worker who opens every letter, reads it, and can rewrite it before delivering it.
- Intercept. A proxy feature that pauses a request or response so you can inspect or change it before it continues.
- Response manipulation. Changing the contents of a server's response before the browser sees it. This is the vulnerability class here.
- Payment bypass. Tricking a system into treating an unpaid order as paid.
Setting up
The only tool named in the report is Burp Suite, connected to the researcher's preferred browser, with the proxy intercepting traffic. No account details, roles, software versions, or other preconditions are given beyond being able to reach the gift card site and go through its checkout.
The test card used is 1337 1337 1337 1337 with expiry date 03/30. The report calls this a test card but does not say more about it.
Finding it: the code that gives it away
The researcher points at the checkout's client-side payment code. "Client-side" means it runs in your browser, not on the server. The relevant part is this function:
function makePayment(data) {
data['paymentMethod'] = $('.checkout__payment').html();
$.ajax({
method: "POST",
url: "/v1/Payment",
data: {paymentData: data},
dataType: "JSON",
success: function(response) {
},
error: function () {
alert('Ooops...');
}
}).then(action => {
if (action == "Authorised") {
dropin.setStatus("success")
$.ajax({
method: "POST",
url: "/v1/HandleResponse",
data: {responseData: action},
dataType: "JSON",
success: function(response) {
window.location = response;
},
error: function (response) {
window.location = response;
}
});
} else if (action == "Refused" || action == "Error") {
dropin.setStatus("error");
$.ajax({
method: "POST",
url: "/v1/HandleResponse",
data: {responseData: action},
dataType: "JSON",
success: function(response) {
window.location = response;
},
error: function (response) {
window.location = response;
}
});
Let's walk through it line by line.
function makePayment(data) {starts a function calledmakePayment. A function is a named block of code that does a job. This one takes somedata(the payment details) and processes it.data['paymentMethod'] = $('.checkout__payment').html();adds a field calledpaymentMethodto the data. It reads the HTML content of the element with the classcheckout__payment(probably the payment method the user chose) and stores it.$is a shorthand from the jQuery library for finding elements on the page.$.ajax({starts an AJAX request, meaning a background call to the server.method: "POST",says this is a POST request. POST is the HTTP method used when you are sending data to the server (as opposed to GET, which is used for fetching).url: "/v1/Payment",is the endpoint being called. This is where the payment is processed.data: {paymentData: data},is the data being sent: the payment details, wrapped in a field calledpaymentData.dataType: "JSON",tells jQuery to expect a JSON response.success: function(response) { },is what to do if the request succeeds. It is empty here, which is interesting: the real work happens in the.then(...)block below.error: function () { alert('Ooops...'); },shows a popup saying "Ooops..." if the request fails at the network level.}).then(action => {is the crucial part. When the request finishes, the result is stored in a variable calledaction. Everything that follows depends on the value ofaction.if (action == "Authorised") {checks whether the result is the exact textAuthorised. If so, the payment is treated as successful.dropin.setStatus("success")updates the payment widget on the page to show a success state.- The next
$.ajax({...})sends a follow-up request to/v1/HandleResponse, passingresponseData: action(which isAuthorised). success: function(response) { window.location = response; },redirects the browser to whatever URL the server returns in the response.window.locationis the browser's address bar; assigning to it navigates the page.error: function (response) { window.location = response; },does the same redirect even if the request errors. So either way, the browser is sent somewhere.} else if (action == "Refused" || action == "Error") {handles the other two possible results:Refused(the card was declined) orError(something went wrong).dropin.setStatus("error");shows an error state in the widget.- The second
$.ajax({...})again calls/v1/HandleResponse, this time withresponseData: actionset toRefusedorError, and again redirects based on the response.
The researcher's reading of this snippet is simple: the developer assumed server responses can be trusted, because a user has no control over what the server returns. With a tool like Burp Suite, however, server responses can be manipulated. So the value compared in action == "Authorised" and the value passed to dropin.setStatus can be controlled by the client.
In plain words: the browser asks the server "did the payment work?", the server says "Refused", and the browser decides what to do based on that word. If you can change the word to "Authorised" before the browser reads it, the browser will happily believe the payment succeeded.
The normal flow
The flow on gifts.jij0.be is described as: item added to cart, user info filled in and checkout reached, user selects pay with card, user enters card, transaction performed, then gifts.jij0.be checks the server responses. The researcher marks this check as where the issue lies. Depending on the result, the user is redirected to the cart if the transaction failed, or to a confirmation page if it succeeded.
A successful transaction follows this sequence:
GET /v1/cart == POST /v1/Payment == [Response: 200 OK Data:"Authorised"] == POST /v1/HandleResponse == GET /confirmation
Read this left to right. The browser first does a GET /v1/cart (fetch the cart page). Then it does a POST /v1/Payment (send the payment). The server replies with 200 OK (HTTP status meaning "success") and the body Authorised. The browser then does POST /v1/HandleResponse (tell the server what happened), and finally GET /confirmation (load the confirmation page).
An unsuccessful transaction follows this one:
GET /nl/cart == POST /v1/Payment == [Response: 200 OK Data:"Refused"] == POST /nl/checkout/HandleResponse == GET /cart
Same shape, but the server's reply body is Refused, and the final page is the cart again. Note that the HTTP status is still 200 OK in both cases. That is important: the server is saying "I successfully processed your request" in both cases, and the actual outcome (paid or not) is only in the body text. A proxy can change the body without touching the status code.
Exploitation: step by step
Now the researcher reproduces the bug. Each step is listed with the reason behind it.
Step 1: Prepare the proxy
Connect Burp Suite to the browser so that traffic to the site passes through it. Without this, you cannot see or change anything. The proxy is the postal worker who can open the letters.
Step 2: Add an item
Go to https://gifts.jij0.be/ and add an item to the cart. You need a real cart to reach the checkout.
Step 3: Start checkout
Proceed to https://gifts.jij0.be/cart and select checkout. This moves you into the payment flow.
Step 4: Fill in details
Follow the prompts to fill in all the required details and proceed to the payment page. The site needs this information to create an order.
Step 5: Enter the test card
Select pay with card and add the test card 1337 1337 1337 1337 with expiry date 03/30. This is a fake card number used for testing. It will not be charged.
Step 6: Observe a failed checkout
Check out once for comparison and observe the failed checkout, which redirects to https://gifts.jij0.be/cart. Doing this first gives you a baseline: you see what a genuine refusal looks like, so you can recognise the difference later.
Step 7: Return to payment
Go to payment again and repeat step 5, but do not send the request yet. You are setting up the same situation, but this time you will pause before the browser sends the payment.
Step 8: Capture the payment request
In Burp, turn intercept on, send the request, and make sure the POST /v1/Payment request is captured. Intercept means Burp holds the request so you can inspect it. You want to catch the payment request specifically, because that is the one whose response you will edit.
Step 9: Intercept the response
Right click and select intercept response for this request, then forward the request. By default Burp intercepts requests; you have to tell it to also intercept the response. Forwarding the request lets it reach the server, so the server will produce a response for you to catch.
Step 10: Read the refusal
Observe the 200 OK response with the data Refused in the body. This is the server telling the browser the card was declined. The status code is 200 OK because the server successfully processed the request; the refusal is in the body.
Step 11: Rewrite the response
Change Refused to Authorised and forward the request, then turn intercept off. This is the actual attack. The browser will now receive Authorised instead of Refused, and the JavaScript will take the success branch: it will call dropin.setStatus("success"), then POST /v1/HandleResponse with Authorised, and then redirect to the confirmation page.
Step 12: Confirmation
The researcher states that a confirmation is then received in the mail. The order is treated as paid even though the card was refused.

The report was sent to the program and, after a few days, accepted as a high severity with a bounty of €500 awarded.
Why it works: the root cause
The checkout decides success or failure in the browser. The makePayment function compares the value returned by the payment call against the strings Authorised, Refused and Error, and drives the UI and the follow-up POST /v1/HandleResponse call from that comparison. Because the comparison happens client-side, an attacker who can intercept the response can substitute Authorised for Refused. The client then treats the transaction as approved, calls HandleResponse with Authorised, and follows the redirect to the confirmation page.
The report does not describe what the server does with the Authorised value sent to POST /v1/HandleResponse. The developer's assumption that the server response can be trusted is what fails, because the response is what the attacker controls.
A useful comparison: imagine a shop assistant who asks the till "did this customer pay?" and then hands over the goods based only on the till's spoken answer. If a customer can stand between the till and the assistant and say "yes, they paid", the assistant will hand over the goods.
Impact
An attacker who can intercept their own traffic can turn a refused card payment into an apparently successful one, receiving a confirmation for an order that was not paid for. The report shows this against the gift card checkout on gifts.jij0.be, with the confirmation arriving by mail. The report does not describe limits such as order value caps, manual review, or whether the confirmation leads to fulfilment; those are not stated.
In plain terms: the site treats a refused payment as successful and a confirmation is received by mail. The severity was rated high, and the bounty was €500.
Fix
Variants to test
If you want to look for similar bugs on other sites, here are starting points. Each one is a variation on the same idea: find a place where the browser trusts a value it should not.
- Intercept the payment response on other checkouts and change a failure value to a success value. A positive result is the client proceeding to a confirmation page or equivalent success state.
- Look for client-side comparisons of payment status strings in JavaScript, such as
Authorised,Refused,Error,successorfailed. A positive result is a branch that changes UI state or triggers a follow-up request based only on that value. - Check whether the follow-up handler endpoint, here
POST /v1/HandleResponse, accepts a client-supplied status and acts on it. A positive result is the server returning a confirmation redirect for a status the client supplied. - Replay a successful response against a new order or a different cart. A positive result is a confirmation for an order that was never paid.
- Test the same manipulation on the failure path, for example changing
ErrortoAuthorised, to see whether every branch is equally exposed. A positive result is any branch that can be flipped to success.
Glossary
- AJAX: a technique where JavaScript sends requests to a server in the background, without reloading the page.
- API: a set of addresses on a server that programs talk to, exchanging structured data.
- Authorised: in this report, the string the payment server returns when a payment succeeds.
- Burp Suite: a proxy tool used by security researchers to inspect, pause, and edit traffic between a browser and a server.
- Client: the browser running on the user's computer, as opposed to the server.
- Client-side: code that runs in the browser rather than on the server.
- Endpoint: a specific address on a server that performs one job, such as
/v1/Payment. - Function: a named block of code that performs a task.
- GET: an HTTP method used to fetch something from a server.
- HTTP: the protocol browsers and servers use to exchange requests and responses.
- Intercept: a proxy feature that pauses a request or response so it can be inspected or changed.
- JavaScript: the programming language that runs in browsers and makes pages interactive.
- JSON: a text format for structured data, such as
{"status": "Authorised"}. - jQuery: a JavaScript library that simplifies tasks like finding page elements and sending AJAX requests; the
$symbol is its shorthand. - POST: an HTTP method used to send data to a server.
- Proxy: a tool that sits between a browser and a server and can see, pause, and edit traffic in both directions.
- Refused: in this report, the string the payment server returns when a payment is declined.
- Request: a message a browser sends to a server asking it to do something.
- Response: the message a server sends back.
- Response manipulation: changing the contents of a server's response before the browser reads it.
- Root cause: the underlying reason a vulnerability exists.
- Server: the computer owned by the shop that stores data and makes decisions.
- Status code: a number in an HTTP response indicating the outcome of the request, such as
200 OKfor success. - Test card: a fake card number used in test environments; it cannot be charged.
- Vulnerability: a weakness in a system that can be exploited to cause harm or gain unauthorised benefit.
window.location: the browser's address bar; assigning to it navigates the page to a new URL.