Exploiting an unknown vulnerability
A consultant could change their fee while a client was booking, causing the client to be charged a higher amount than displayed. The attacker exploited a race condition by rapidly changing the fee in multiple requests.
Published on medium.com
{{media:0}}
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
Abhishek Bundela found this vulnerability around two months before publishing the write-up on 3 October 2018, in a consulting application. The application's core functionality is to provide consulting services to various clients, and it has two user roles: consultant and client.
A consultant sets a fee in coins for their service. A client visits the consultant's timeline, selects an appropriate time slot and books it, and coins are deducted from the client's account according to the fee shown in the timeline for that slot. The application also has an offer feature, in which consultants can set a discount for a certain period of time.
The application's security team told him the application had already been pentested and that they would pay a bonus if he could find a vulnerability. For new targets he first analyses the application and draws a data flow diagram of its functionality, then starts hunting. He tests extensively for logical vulnerabilities, because in his experience there are critical transitions that developers or testers may have missed.
He deliberately left the details out of the title, naming it an "unknown" vulnerability, so that the post works both as an exercise and as a write-up.
Setup
The report does not describe the tooling used beyond sending multi-threaded requests to the web server, nor does it give versions of anything. The requests shown are JSON bodies sent with POST.
Finding it
The two normal operations look like this. The consultant sets a fee in coins for a timing:
# consultant requestPOST /set/fee/{"value": 5, "timing":2}
The client books a timing:
# client requestPOST /consultant_username/book{"timing":2}
Before reading further, the author suggests the reader write down their own test cases or approach for exploiting the functionality.

His list of test cases was:
- Injection vulnerabilities such as SQL injection and command injection.
- Modifying the content type and request data to XML to test for XML injection.
- Booking the consultant's higher value time slots for fewer coins.
- Injecting the
valueparameter from the consultant request and using it in the client request. - Parameter pollution by injecting two
timingvalues in the client request. - Array based injection using the
timingvalue in the client request, i.e.{"timing[0]":2}. - HTTP method tampering by changing POST to PUT.
- Booking two or more time slots of the same consultant by playing multi-threaded client requests (race condition).
- Booking two different consultants' time slots by playing multi-threaded client requests (race condition).
None of these worked. The author suggests their security team may have mitigated these vulnerabilities, or that experienced developers built the application.
The next day he looked again and his attention went to the booking request: no coin amount is passed in it, and coins are deducted automatically from the client's account after the client request is submitted.
POST /consultant_username/book{"timing":2}
That raised the question of what happens if the consultant changes the fee to a higher amount just before the client books the time slot. He expected this to work, but it did not: the application showed the message "Consultant's fee for this slot is 10".
Exploitation
He was about to give up when the idea of a race condition came to mind. To test it, he sent multi-threaded requests to the web server with four different consulting fees (5, 15, 15, 5) in four different requests at a time, and put those requests in a loop for half an hour. When a client visits the consultant's timeline during that period, there is a 50% chance that the client ends up paying the higher fee. That is how he was able to exploit the vulnerability by changing the consulting price quickly.
Step 1: Set a low fee and an offer period
The consultant sets a fee of 5 coins for any time slot 'x', and sets an offer period, for example 30 to 60 minutes during a day.
Step 2: Wait for clients to arrive during the offer
Clients visit the consultant's timeline during the offer period and see the discounted price.
Step 3: Flip the price with concurrent consultant requests
The consultant quickly changes the consulting price by playing multi-threaded consultant requests in a loop and sending them to the server.
Step 4: The client books
While that loop is running, the client pays the fee by sending the booking request to the server:
POST /consultant_username/book{"timing":2}
Step 5: Extra coins are deducted
If the booking lands while the higher fee is in effect, extra coins get deducted from the client's account.
Root cause
The booking request carries no price: the amount is taken from the consultant's current fee at the time the booking is processed. The simple version of the attack failed, and the application showed the message "Consultant's fee for this slot is 10". By flipping the fee concurrently, the attacker widens the window in which the charged price differs from the displayed one. The report does not show the server-side code or explain the exact mechanism.
Impact
Consultants can trick clients into paying a higher amount than was shown in their timeline for their services. The attack depends on timing: the client has to book while the fee is being flipped, and the author estimates a 50% chance of the client paying the higher fee during the loop.
Fix
The author's defender takeaway is to make a checklist of vulnerabilities and test it for every feature implemented in the application, and to implement rate limiting and a race condition based locking system to prevent this kind of vulnerability.
Variants to test
- Price or fee fields that are read at checkout rather than carried in the order request: try flipping the value concurrently and see whether the charged amount differs from the displayed one.
- Discount and offer periods: check whether a booking made during an offer can be charged at the post-offer price.
- Any two-step flow where one user's setting affects another user's charge (shipping, tax, commission, exchange rate): loop the setting change while submitting the dependent request.
- Race conditions on the booking endpoint itself, as in the author's original test cases 8 and 9: send multi-threaded booking requests and look for double bookings or double deductions.
- Parameter pollution and array based injection on the
timingfield, e.g.{"timing[0]":2}: a positive result is the server accepting an unexpected timing or price.
Takeaway
As application functionalities grow, complexity grows exponentially and there are more chances to miss test cases during design, development or security testing. The author recommends analysing application functionality by going through request history again and again, understanding data flow, and spending energy on smarter test cases that can break the application's use case.
Learn, Build & Break!
What happened, in plain words
A security researcher, Abhishek Bundela, found a flaw in a consulting application about two months before he published his write-up on 3 October 2018. The application connects consultants with clients. Consultants offer their services for a fee measured in coins, and clients book time slots and pay those coins.
The flaw let a consultant trick a client into paying more coins than the price shown on the consultant's timeline. The trick relied on changing the price very quickly, in a loop, while the client was booking. The researcher called it an "unknown" vulnerability because he left the details out of the title, so the post works both as a puzzle for readers and as a write-up.
Before we go further, a few everyday ideas will help.
- Application: a website or program you use through a browser. Here it is the consulting site.
- API: the set of addresses (called endpoints) that a website's pages use behind the scenes to send and receive data. Think of it as a waiter: you tell the waiter what you want, the waiter takes your order to the kitchen, and brings back your food. Your browser does the same with the application's server.
- Endpoint: a specific address in the API, such as
/set/fee/or/consultant_username/book. Each endpoint does one job. - Request: the message your browser sends to the server, for example "book time slot 2". It has a method (like POST, which means "send this data and create something"), a path (the endpoint), and often a body (the data, usually in JSON format).
- JSON: a simple text format for data, made of names and values in curly braces, like
{"value": 5, "timing":2}. It is easy for both people and programs to read. - Parameter: a named piece of data in a request, such as
valueortiming. - Coin: the application's internal currency. Clients spend coins to pay consultants.
- Timeline: the consultant's public page showing their available time slots and prices.
- Race condition: a bug that appears when two actions happen at almost the same moment and the system is not prepared for the order in which they finish. Imagine two people grabbing the last seat on a train at the same instant: the booking system might sell it twice, or charge the wrong price, because it checked availability before either person finished paying.
- Pentest: a penetration test, a deliberate security check of an application by specialists.
- Logical vulnerability: a flaw in the rules or business logic of an application, rather than in its code syntax. For example, a shop that lets you apply a discount twice.
- Injection: when an attacker slips extra data into a request so the server treats it as instructions. SQL injection targets databases; command injection targets the operating system.
- Parameter pollution: sending the same parameter more than once, hoping the server picks the wrong one.
- HTTP method tampering: changing the method of a request (for example from POST to PUT) to see if the server handles it differently.
- Rate limiting: a defence that stops a client from sending too many requests in a short time.
- Locking: a defence where the system makes one action wait until another finishes, so two actions cannot overlap in a harmful way.
The application and the two roles
The application's core functionality is to provide consulting services to various clients. There are two types of user roles: consultant and client.
A consultant sets a fee in coins for their service. A client visits the consultant's timeline, selects an appropriate time slot and books it. Coins are deducted from the client's account according to the fee shown in the timeline for that slot. The application also has an offer feature, in which consultants can set a discount for a certain period of time.
The application's security team told him the application had already been pentested and that they would pay a bonus if he could find a vulnerability. For new targets he first analyses the application and draws a data flow diagram of its functionality, then starts hunting. A data flow diagram is a simple drawing of how information moves through the application: who sends what, where it is stored, and who reads it. He tests extensively for logical vulnerabilities, because in his experience there are critical transitions that developers or testers may have missed.
The two normal operations
The two normal operations look like this. The consultant sets a fee in coins for a timing:
# consultant requestPOST /set/fee/{"value": 5, "timing":2}
Line by line:
# consultant requestis a comment, a note for the reader. It says this is the request a consultant sends.POST /set/fee/is the method and the endpoint. POST means "send data and create or change something"./set/fee/is the address that sets a fee.{"value": 5, "timing":2}is the JSON body.valueis the fee in coins, here 5.timingis the time slot, here slot 2.
So the consultant is saying: "For time slot 2, charge 5 coins."
The client books a timing:
# client requestPOST /consultant_username/book{"timing":2}
Line by line:
# client requestis a comment saying this is the request a client sends.POST /consultant_username/bookis the method and endpoint.consultant_usernameis a placeholder for the consultant's username./bookis the address that makes a booking.{"timing":2}is the JSON body. It says which time slot the client wants, here slot 2. Notice there is no price in this request.
So the client is saying: "Book me time slot 2 with this consultant." The server is expected to look up the consultant's current fee for slot 2 and deduct that amount from the client's coins.
Before reading further, the author suggests the reader write down their own test cases or approach for exploiting the functionality.

His list of test cases was:
- Injection vulnerabilities such as SQL injection and command injection.
- Modifying the content type and request data to XML to test for XML injection.
- Booking the consultant's higher value time slots for fewer coins.
- Injecting the
valueparameter from the consultant request and using it in the client request. - Parameter pollution by injecting two
timingvalues in the client request. - Array based injection using the
timingvalue in the client request, i.e.{"timing[0]":2}. - HTTP method tampering by changing POST to PUT.
- Booking two or more time slots of the same consultant by playing multi-threaded client requests (race condition).
- Booking two different consultants' time slots by playing multi-threaded client requests (race condition).
None of these worked. The author suggests their security team may have mitigated these vulnerabilities, or that experienced developers built the application.
A second look at the booking request
The next day he looked again and his attention went to the booking request: no coin amount is passed in it, and coins are deducted automatically from the client's account after the client request is submitted.
POST /consultant_username/book{"timing":2}
Line by line:
POSTis the method, meaning "send this data and create a booking"./consultant_username/bookis the endpoint for booking with a particular consultant.{"timing":2}is the body, naming the time slot. There is novaluefield, so the client does not state a price. The server must decide the price.
That raised the question of what happens if the consultant changes the fee to a higher amount just before the client books the time slot. He expected this to work, but it did not: the application showed the message "Consultant's fee for this slot is 10".
The application showed the message "Consultant's fee for this slot is 10", and the simple price change did not work.
Exploitation: the race condition
He was about to give up when the idea of a race condition came to mind. To test it, he sent multi-threaded requests to the web server with four different consulting fees (5, 15, 15, 5) in four different requests at a time, and put those requests in a loop for half an hour. When a client visits the consultant's timeline during that period, there is a 50% chance that the client ends up paying the higher fee. That is how he was able to exploit the vulnerability by changing the consulting price quickly.
"Multi-threaded" means sending several requests at the same time, from several parallel workers, instead of one after another. Think of four cashiers serving four customers simultaneously rather than one queue. The server has to handle all four at once, and if it is not careful, the order in which it processes them can create a gap.
Step 1: Set a low fee and an offer period
The consultant sets a fee of 5 coins for any time slot 'x', and sets an offer period, for example 30 to 60 minutes during a day.
Step 2: Wait for clients to arrive during the offer
Clients visit the consultant's timeline during the offer period and see the discounted price. They believe they will pay 5 coins.
Step 3: Flip the price with concurrent consultant requests
The consultant quickly changes the consulting price by playing multi-threaded consultant requests in a loop and sending them to the server.
Step 4: The client books
While that loop is running, the client pays the fee by sending the booking request to the server:
POST /consultant_username/book{"timing":2}
Line by line:
POSTsends the booking./consultant_username/bookis the booking endpoint.{"timing":2}asks for slot 2.
The client still expects to pay the price they saw, but the server reads whatever fee is current at that instant.
Step 5: Extra coins are deducted
If the booking lands while the higher fee is in effect, extra coins get deducted from the client's account.
Why it works
The booking request carries no price: the amount is taken from the consultant's current fee at the time the booking is processed. The simple version of the attack failed, and the application showed the message "Consultant's fee for this slot is 10". "Serialise" means making actions happen one at a time, in a strict order, rather than overlapping. By flipping the fee concurrently, the attacker widens the window in which the charged price differs from the displayed one. The report does not show the server-side code or explain the exact mechanism.
Impact
Consultants can trick clients into paying a higher amount than was shown in their timeline for their services. The attack depends on timing: the client has to book while the fee is being flipped, and the author estimates a 50% chance of the client paying the higher fee during the loop. The report does not state a bounty amount or a severity rating.
Fix
The author's defender takeaway is to make a checklist of vulnerabilities and test it for every feature implemented in the application, and to implement rate limiting and a race condition based locking system to prevent this kind of vulnerability.
Variants to test
- Price or fee fields that are read at checkout rather than carried in the order request: try flipping the value concurrently and see whether the charged amount differs from the displayed one.
- Discount and offer periods: check whether a booking made during an offer can be charged at the post-offer price.
- Any two-step flow where one user's setting affects another user's charge (shipping, tax, commission, exchange rate): loop the setting change while submitting the dependent request.
- Race conditions on the booking endpoint itself, as in the author's original test cases 8 and 9: send multi-threaded booking requests and look for double bookings or double deductions.
- Parameter pollution and array based injection on the
timingfield, e.g.{"timing[0]":2}: a positive result is the server accepting an unexpected timing or price.
Takeaway
As application functionalities grow, complexity grows exponentially and there are more chances to miss test cases during design, development or security testing. The author recommends analysing application functionality by going through request history again and again, understanding data flow, and spending energy on smarter test cases that can break the application's use case.
Learn, Build & Break!
Glossary
- API: the set of addresses and rules a website uses to send and receive data behind the scenes.
- Array based injection: sending a parameter as an array (for example
timing[0]) to see if the server mishandles it. - Coin: the application's internal currency used to pay consultants.
- Command injection: slipping operating system commands into a request so the server runs them.
- Concurrent: happening at the same time.
- Consultant: a user who offers services and sets fees.
- Client: a user who books and pays for services.
- Data flow diagram: a drawing of how information moves through an application.
- Endpoint: a specific address in an API that performs one job.
- HTTP method: the verb of a request, such as POST (send data) or PUT (replace data).
- HTTP method tampering: changing the method of a request to see if the server behaves differently.
- Injection: slipping extra data into a request so the server treats it as instructions.
- JSON: a simple text format for data made of names and values in curly braces.
- Locking: a defence where one action waits for another to finish, preventing harmful overlap.
- Multi-threaded: sending several requests at the same time from parallel workers.
- Request: the message a browser sends to a server, with a method, a path and often a body.
- Serialise: make actions happen one at a time, in a strict order.
- SQL injection: slipping database commands into a request so the server runs them.
- Timeline: the consultant's public page showing available time slots and prices.
- XML injection: slipping XML markup into a request to see if the server mishandles it.