Race Condition Leading to Bypass of Free Plan Limits
Published on medium.com
Today I am going to write about a specific vulnerability that i found in some of the web applications I came across . The vulnerability is race condition .
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
A race condition was found in a freelance marketplace platform that connects freelancers with clients. The platform sells plans, and the free plan imposes hard limits on what a freelancer can publish:
- a maximum of 10 services per user;
- 5 images and 1 video per service.
Anything beyond those numbers is meant to require an upgrade to a paid plan. The affected functionality is the service creation and media upload API:
POST /api/v/services/ServiceNo/media
POST /api/v/services/ServiceNo
A race condition, as the author frames it, occurs when multiple threads access the same shared code, variables or files simultaneously without locking or synchronisation, producing an inconsistent result. It is a common bug on sites that manage balances, vouchers or other limited resources.
Setup
The write-up does not describe the account setup, the tool versions or any other precondition beyond a free-plan account on the marketplace. The steps refer to intercepting requests and sending them to Repeater, but the report does not say which tool or feature was used to send them concurrently. No specific build or version is given.
Finding it
The researcher started from the plan limits themselves. On the free plan a freelancer can hold at most 10 services, each with at most 5 images and 1 video. When testing those limits, a race condition was the first attack vector considered: When testing those limits, a race condition was the first attack vector considered.
Exploitation
Step 1: Bypassing the media limits
Media uploads were the simpler case. By sending multiple concurrent requests while uploading media, it was possible to upload more than 5 images and more than 1 video to a single service. The application failed to enforce the limit under concurrent conditions.
The reproduction steps are:
- Create a new service.
- At the media upload fields (images, videos, files), intercept the request and send it to Repeater.
- Send multiple concurrent requests at the same time.
- This allows uploading all media sent simultaneously, bypassing the defined limits.
The request to intercept is the media endpoint:
POST /api/v/services/ServiceNo/media
ServiceNo is the placeholder for the service identifier in the path; the media is attached to that service. Because the requests are issued together rather than one after another, the per-service count is not enforced across them.
Step 2: Why the service limit needed a different approach
Bypassing the maximum of 10 services was more complex. Creating a service is not a single request but a sequence:
- Create service
- Set service price
- Upload images
- Upload video
- Final publish/save request
Sending all of these requests in parallel did not work reliably. The platform does, however, provide a draft feature that lets users save incomplete services and publish them later. The platform provides a draft feature that lets users save incomplete services and publish them later.
Step 3: Preparing the drafts
- Create multiple incomplete services (more than 10) and save them as drafts.
- Once the desired number of drafts is ready, simultaneously send the final "Publish" request for all of them using a race condition.
The application processes multiple concurrent publish requests and successfully publishes more than 10 services, completely bypassing the free plan restriction.
Step 4: The full reproduction
- Create a new service.
- Continue the service creation process, but intercept and pause the final "publish service" request.
- Save the service ID from the request, then create another service and save its ID as well.
- Repeat this process for multiple services.
- Finally, send multiple concurrent requests using the collected service IDs at the same time.
- This results in bypassing the limits on both:
- Number of services per user
- Number of media files per service
The publish request targets the service endpoint with the collected identifier:
POST /api/v/services/ServiceNo
The two screenshots below show the result: the limits on the number of services per user and on the number of media files per service are both exceeded.


Root cause
The application failed to enforce the limits under concurrent conditions. When several requests arrive concurrently, the limits were not enforced across them. The draft and publish split makes this especially visible for services: the expensive multi-request creation is done ahead of time, and only the final publish request has to be raced.
Impact
- Paid plan bypass: attackers can exceed subscription limits (services, images, videos, files) without upgrading, causing direct revenue loss.
- Resource abuse: unrestricted uploads can lead to excessive consumption of storage, bandwidth and system resources.
The report does not quantify how much can be uploaded beyond the limits.
Fix
The measure the behaviour calls for is to make the limit check and the write a single atomic operation, for example by enforcing the count inside the same transaction or with a database constraint, and by serialising concurrent publish requests for the same account so that only the permitted number succeed.
Variants to test
- Other per-account quotas: apply the same concurrent-send technique to any endpoint that creates a limited resource (projects, listings, invites, API keys). A positive result is more objects created than the plan allows.
- Per-object child limits: race the creation of child records under one parent, as with media under a service, on other upload endpoints. A positive result is more children than the documented cap.
- Draft-then-publish flows: look for any feature that separates saving from activating (drafts, scheduled posts, pending approvals) and race the activation step. A positive result is more activated objects than the limit permits.
- Multi-step creation: where a single parallel burst of the whole sequence fails, try preparing all objects first and racing only the final committing request, as done here. A positive result is the same over-limit state reached reliably.
What happened, in plain words
A freelance marketplace is a website where people who sell their work (freelancers) put up listings, and people who want work done (clients) browse those listings. The site makes money by selling plans. On the free plan, a freelancer is allowed to publish at most 10 services, and each service can hold at most 5 images and 1 video. If you want more than that, you are supposed to pay for an upgraded plan.
A security researcher found that this limit could be beaten without paying. The trick is called a race condition. The name comes from the idea of a race: several things happen at almost the same moment, and the program is not prepared for that. Imagine a nightclub with one doorman and a rule of "ten people inside". If ten people walk in one at a time, the doorman counts correctly and stops the eleventh. But if twenty people push through the door at the same instant, the doorman may look at the room, see it is not full yet, and let several of them in before anyone has actually sat down. The count is only updated after people are already inside, so the rule is broken.
That is the idea behind the bug. When many requests arrived together, the limit was not enforced and more services were created than the plan allows. When many requests arrived together, the application failed to enforce the limit and more services were created than allowed. The same idea worked for images and videos attached to a single service.
This article walks through the same steps the researcher took, but explains every term from scratch. You only need to know how to use a browser and a computer to follow along.
Some words you will meet first
Before the steps, a few ideas need to be clear.
API. An API (Application Programming Interface) is the set of doors a website offers to programs, as opposed to the pages it offers to people. When you click a button in your browser, the page often sends a small message behind the scenes to one of those doors, and the server replies with data. Think of a restaurant: the menu you read is the website, and the kitchen door where the waiter hands over your order is the API. You normally never see it, but it is there.
Request. A request is one message sent to the server. It has a method (what kind of action), a URL (where it goes), sometimes a body (the data being sent), and headers (extra information about the message). The two methods you will see here are POST, which means "create or send something", and the URL paths start with /api/, which is a common way of marking API doors.
Endpoint. An endpoint is one specific API door, identified by its method and path. POST /api/v/services/ServiceNo is one endpoint; POST /api/v/services/ServiceNo/media is another. ServiceNo is a placeholder: in a real request it is replaced by the number that identifies a particular service.
Intercepting proxy. A proxy is a program that sits between your browser and the website. An intercepting proxy lets you pause a request before it leaves, look at it, change it, and send it again. This is how security testers see what the browser is really sending. The steps refer to a feature called Repeater, a screen where you can hold a request and resend it.
Concurrent requests. Concurrent means "at the same time", or as close to the same time as a computer can manage. Sending requests one after another is sequential; sending a batch together is concurrent. The whole attack depends on this difference.
Race condition. A race condition is a bug where a program gives a different, wrong result when several actions happen at once than it would if they happened one by one. It is common on sites that manage balances, vouchers, or other limited resources, because those sites always have a "check the limit, then use the resource" pattern, and that pattern is exactly what breaks under concurrency.
Draft. A draft is a saved but unpublished version of something. Many sites let you save work in progress and publish it later. Here, the draft feature turned out to be the key that made the service-limit bypass reliable.
The two endpoints involved
The affected functionality is the service creation and media upload API:
POST /api/v/services/ServiceNo/media
POST /api/v/services/ServiceNo
Line by line:
POST /api/v/services/ServiceNo/mediais the endpoint that attaches media (images, video, files) to a service. The wordmediaat the end says what it is for.ServiceNostands for the identifier of the service the media belongs to.POST /api/v/services/ServiceNois the endpoint that creates or acts on a service itself. The sameServiceNoplaceholder appears in the path.
Both are POST requests, which fits the idea of creating something. The /api/v/ part is just the site's internal naming for its API version; you do not need to interpret it further.
How the researcher found it
The starting point was the plan limits themselves. On the free plan a freelancer can hold at most 10 services, each with at most 5 images and 1 video. When testing those limits, a race condition was the first attack vector considered. An attack vector is simply a way in, a category of attack worth trying first.
The reasoning is worth spelling out because it is the heart of the bug. If the server checks the limit and creates the resource as separate steps, there is a gap between them. A single request is fine: it counts, sees 9, creates the tenth. But if several requests arrive in that gap, each one may pass the check before any of them has written its result. The limit was checked, but it was not enforced at the moment of writing.
Step 1: Bypassing the media limits
Media uploads were the simpler case. By sending multiple concurrent requests while uploading media, it was possible to upload more than 5 images and more than 1 video to a single service. The application failed to enforce the limit under concurrent conditions.
The reproduction steps are:
- Create a new service.
- At the media upload fields (images, videos, files), intercept the request and send it to Repeater.
- Send multiple concurrent requests at the same time.
- This allows uploading all media sent simultaneously, bypassing the defined limits.
Why each step matters:
- You need a service to attach media to, so you start by creating one in the normal way through the website.
- When you pick files to upload, the browser sends a request to the media endpoint. The intercepting proxy catches that request before it leaves, so you can see exactly what it contains and keep a copy. Sending it to Repeater means it is now sitting in a screen where you can fire it again and again.
- Instead of clicking send once, you send the same request many times in a single burst. Because they all arrive together, the application failed to enforce the per-service limit.
- The result is that more media ends up attached to the service than the plan allows.
The request to intercept is the media endpoint:
POST /api/v/services/ServiceNo/media
This is the same endpoint shown earlier. ServiceNo is the placeholder for the service identifier in the path; the media is attached to that service. Because the requests are issued together rather than one after another, the per-service count is not enforced across them. In plain terms: the requests were sent together and the application did not enforce the limit across them.
Step 2: Why the service limit needed a different approach
Bypassing the maximum of 10 services was more complex. Creating a service is not a single request but a sequence:
- Create service
- Set service price
- Upload images
- Upload video
- Final publish/save request
Sending all of these requests in parallel did not work reliably. The report only notes that sending all of these requests in parallel did not work reliably. Firing the whole chain at once means some requests arrive before the thing they depend on exists, so the chain breaks.
The platform does, however, provide a draft feature that lets users save incomplete services and publish them later. The platform provides a draft feature that lets users save incomplete services and publish them later. In other words, drafts are saved first, and the final publish requests are then sent together.
Step 3: Preparing the drafts
- Create multiple incomplete services (more than 10) and save them as drafts.
- Once the desired number of drafts is ready, simultaneously send the final "Publish" request for all of them using a race condition.
The application processes multiple concurrent publish requests and successfully publishes more than 10 services, completely bypassing the free plan restriction.
The report does not explain how drafts are counted against the limit. The moment of truth is the publish request. If you send all the publish requests together, the application processes them concurrently and publishes more than 10 services.
Step 4: The full reproduction
- Create a new service.
- Continue the service creation process, but intercept and pause the final "publish service" request.
- Save the service ID from the request, then create another service and save its ID as well.
- Repeat this process for multiple services.
- Finally, send multiple concurrent requests using the collected service IDs at the same time.
- This results in bypassing the limits on both:
- Number of services per user
- Number of media files per service
A few of these steps deserve a plain explanation.
Step 5 is where the draft trick is used. You go through the normal creation flow, but at the very last moment, when the browser would send the publish request, the proxy holds it. The service stays unpublished, which is what you want for now.
Step 6 is about collecting identifiers. Every service has a unique number, its service ID, which appears in the URL of the publish request. By saving each ID, you build a list of services that are all waiting to be published. You then create the next service and save its ID too.
Step 8 is the race itself. With the list of IDs in hand, you send one publish request per ID, all at the same moment. Each request is a normal, valid request; the only unusual thing is the timing.
The publish request targets the service endpoint with the collected identifier:
POST /api/v/services/ServiceNo
Here ServiceNo is replaced by each saved service ID in turn. So if you collected IDs for several services, you end up with several requests that look identical except for that number, and you fire them together.
The two screenshots below show the result: the limits on the number of services per user and on the number of media files per service are both exceeded.


Why the bug exists
The application failed to enforce the limits under concurrent conditions. Atomic here means "all at once, indivisible". A check that is not atomic is a check that happens separately from the action, with a gap in between. When several requests arrive concurrently, the limits were not enforced across them.
The draft and publish split makes this especially visible for services: the expensive multi-request creation is done ahead of time, and only the final publish request has to be raced. The report does not show the server-side code, so the exact implementation, for example whether the check is a separate query before the insert, is likely rather than confirmed.
What the impact is
- Paid plan bypass: attackers can exceed subscription limits (services, images, videos, files) without upgrading, causing direct revenue loss.
- Resource abuse: unrestricted uploads can lead to excessive consumption of storage, bandwidth and system resources.
In everyday terms: the company loses money because people get paid features for free, and the servers have to store and serve more files than the business planned for. The report does not quantify how much can be uploaded beyond the limits.
How it should be fixed
The measure the behaviour calls for is to make the limit check and the write a single atomic operation, for example by enforcing the count inside the same transaction or with a database constraint, and by serialising concurrent publish requests for the same account so that only the permitted number succeed.
A transaction is a group of database actions that either all happen or none happen, so nothing can slip in between them. A database constraint is a rule the database itself refuses to break, such as "no more than ten rows with this user's number". Serialising means making the requests take turns instead of running together. Any of these closes the gap that the race condition exploits.
Other places to try the same idea
- Other per-account quotas: apply the same concurrent-send technique to any endpoint that creates a limited resource (projects, listings, invites, API keys). A positive result is more objects created than the plan allows.
- Per-object child limits: race the creation of child records under one parent, as with media under a service, on other upload endpoints. A positive result is more children than the documented cap.
- Draft-then-publish flows: look for any feature that separates saving from activating (drafts, scheduled posts, pending approvals) and race the activation step. A positive result is more activated objects than the limit permits.
- Multi-step creation: where a single parallel burst of the whole sequence fails, try preparing all objects first and racing only the final committing request, as done here. A positive result is the same over-limit state reached reliably.
The general lesson is simple: whenever a website says "you may have at most N of these", it is worth asking whether the counting and the creating happen in one indivisible step. If they do not, sending the requests together may get you more than N.
Glossary
- API: the set of doors a website offers to programs, as opposed to the pages it offers to people; requests go to these doors and replies come back as data.
- Endpoint: one specific API door, identified by its method and path, such as
POST /api/v/services/ServiceNo. - Request: one message sent to a server, with a method, a URL, optional headers and an optional body.
- POST: the request method normally used to create or send something to the server.
- Header: extra information attached to a request or reply, separate from the main content.
- Intercepting proxy: a program between your browser and a website that can pause, inspect, change and resend requests.
- Repeater: a screen in an intercepting proxy where a captured request can be held and resent as many times as you like.
- Concurrent: happening at the same time, or as close to it as a computer can manage.
- Sequential: happening one after another, each waiting for the previous one to finish.
- Race condition: a bug where several actions happening at once produce a wrong result that would not happen if they ran one by one.
- Atomic: done as a single indivisible step, so nothing can happen in the middle of it.
- Transaction: a group of database actions that either all succeed or none do.
- Database constraint: a rule enforced by the database itself, which refuses to store data that breaks it.
- Serialising: making requests take turns instead of running together.
- Draft: a saved but unpublished version of something, which can be published later.
- Service ID: the unique number that identifies one service, used in the URL of requests that act on it.
- Attack vector: a way in, a category of attack worth trying.
- Plan limit / quota: the maximum amount of something a user is allowed under their subscription.
- Paid plan bypass: getting the benefits of a paid subscription without paying for it.
- Resource abuse: using more storage, bandwidth or computing power than the service intended.
- Free plan: the subscription level that costs nothing and comes with the tightest limits.