Skip to content
Race condition Write-up Beginner

Exploiting Race Condition to Break Idempotency & Corrupt Data Integrity

A job portal's save/favourite feature checked whether a job was already saved and then wrote a new record, without making the two steps atomic. Sending several identical save requests at once caused the same job to be stored multiple times in the user's saved list.

coolorangee3 Follow

Published on medium.com

Race Condition

Coolorangee, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target was jobs.target.com, the career portal of a hospitality company, tested through a HackerOne program. The feature in question is the familiar "Save" or "Favorite" control on a job posting: an authenticated user clicks a heart icon and the job is added to their "Saved Jobs" cart.

The expected behaviour, as the author lays it out, is threefold:

  1. Saving a job puts it in the user's "Saved Jobs" cart.
  2. Clicking the control again either unsaves it or does nothing, which is idempotency.
  3. One account holds only one saved instance of a given job.

The report was a real finding but was ultimately closed as N/A (Out of Scope), so no bounty or severity rating is attached to it. The write-up is about the class of flaw rather than a paid result.

Setup

The only tooling described is Burp Suite Professional, specifically Repeater's tab grouping and its parallel send mode. The precondition is a normal authenticated user account on jobs.target.com with an empty "Saved Jobs" list, so that any duplicates that appear afterwards are unambiguous.

No versions, headers, cookies or request bodies are reproduced in the report; the only request detail given is the method and path.

Finding it

The author suspected a Time-of-Check to Time-of-Use (TOCTOU) flaw in the save flow. The reasoning is straightforward: when a user saves a job, the server checks whether the job is already saved, and if it is not, it writes the entry to the database. If several requests arrive concurrently, the server may complete the check phase for all of them before any of them reaches the write phase. Every concurrent request then sees an unsaved job and each one writes its own row, producing duplicate entries for the same job.

The question that drove the test was simply: what happens if multiple requests are sent at the exact same millisecond?

Exploitation

Step 1: Prepare a clean account

The author logged into a normal user account on jobs.target.com and made sure the "Saved Jobs" list was empty, giving a clean baseline for the test.

Step 2: Capture the save request

The author browsed the job listings, found an unsaved job, turned on interception in Burp Suite, and clicked the heart/save control. The intercepted request was sent to Repeater and all remaining requests were dropped, so the like action itself was cancelled and never reached the server. What remained was the save request sitting in Repeater.

The application sent a POST request to the /widgets endpoint. That is the only request detail the report gives: no parameters, headers or body are shown.

Step 3: Duplicate the request

The exact same request was duplicated into 7 identical Repeater tabs.

Step 4: Send the group in parallel

Beside the Repeater tabs there is a "+" icon. The author clicked it, chose "Create tab group", ticked all the tabs and clicked create, which placed all 7 tabs into a single group. On the tabs group, the dropdown was opened, "Send group in parallel (single-packet attack)" was selected, and "send group (parallel)" was clicked.

Dropdown on the tabs group From the original on medium.com

Dropdown on the tabs group

From the original on medium.com
Results (Duplicated Saved jobs)

Results (Duplicated Saved jobs)

Step 5: Verify persistence

After firing the grouped requests, the author went back to the Job Cart / saved-jobs page and refreshed it. The same job appeared multiple times in the saved jobs list.

To rule out a transient UI glitch or front-end desynchronisation, the page was refreshed several times. The duplicate entries persisted. As a further check, deleting one of the duplicates removed only that specific entry, while the other cloned copies stayed in the account. That suggests the duplicates are separate records rather than one record rendered repeatedly.

Root cause

The report describes the mechanism as a TOCTOU race: the existence check and the insert are not atomic with respect to each other, so concurrent requests all pass the check before any insert lands. What it does establish is that no effective defence was in place: the parallel requests produced persistent duplicate records, and deleting one left the rest untouched.

Impact

By exploiting this race condition, an attacker, or indeed a normal user, can fire concurrent save requests for the same job and cause persistent duplicate records. This breaks the idempotency of the save/favourite workflow and corrupts the integrity of the database state for the user's account.

The effect is scoped to the acting user's own account in the described test. The report does not demonstrate cross-user impact, resource exhaustion at scale, or any downstream effect on other features, and it does not claim them.

Fix

The report does not say what was changed, if anything, and the issue was closed as out of scope.

Variants to test

The takeaway the author draws is that state-changing endpoints beyond payments and coupons are worth testing this way: "Add to Cart", "Save Job" and "Follow User" are all prone to concurrent execution flaws. Concretely, on another target:

  1. Identify a create-style action that should be unique per user, such as saving, favouriting, following or adding to a cart.
  2. Capture the request once, duplicate it into several Repeater tabs, group them and send the group in parallel with the single-packet attack option.
  3. A positive result looks like the same item appearing multiple times after a refresh, with each copy behaving as an independent record, for example deleting one leaves the others in place.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

A security researcher was testing a job website, jobs.target.com, through a bug bounty platform called HackerOne. A bug bounty programme is a scheme where a company invites outside people to look for security problems in its systems and report them, sometimes for a reward. The researcher found a real flaw: by clicking the "save this job" button in a way that sent several copies of the same request to the server at almost exactly the same moment, the website ended up storing the same job several times in the user's saved list. The report was closed as N/A (Out of Scope), meaning the company decided the issue fell outside the rules of the programme, so no reward or severity rating is attached to it. The write-up is still useful because the flaw is a common and instructive one.

The target and the feature

The site is a career portal for a hospitality company. Like many job sites, it lets a logged-in user save a job posting by clicking a heart icon, and the job then appears in a "Saved Jobs" cart. A cart here just means a personal list attached to the account.

The researcher sets out what a user should reasonably expect:

  1. Saving a job puts it in the "Saved Jobs" cart.
  2. Clicking the control again either unsaves it or does nothing. Doing nothing the second time is called idempotency: an action that, repeated, leaves things in the same state as doing it once. Pressing a lift button twice still calls one lift.
  3. One account holds only one saved copy of a given job.

The question that started the test was simple: what happens if several requests are sent at the exact same millisecond?

The idea behind the flaw

The researcher suspected a Time-of-Check to Time-of-Use flaw, usually shortened to TOCTOU. The name describes the gap between the moment a system checks something and the moment it acts on that check. A everyday comparison: you check that a seat on a train is free, walk to the ticket desk, and by the time you buy, someone else has taken it. Your check was true when you made it and false when you used it.

On this site, when a user saves a job, the server first checks whether the job is already saved. If it is not, the server writes the entry into its database. If several requests arrive at the same time, the server may finish the check for all of them before any of them gets to the write. Every request then sees an unsaved job, and each one writes its own entry, so the same job is stored several times.

Setting up

The only tool described is Burp Suite Professional, a program security testers use to watch and edit the traffic between a browser and a website. Within it, the researcher used Repeater, a part of Burp where you can hold a single request, change it, and send it again as often as you like, and the tab grouping feature that lets several such requests be sent together.

The precondition was a normal logged-in account on jobs.target.com with an empty "Saved Jobs" list. Starting from empty matters: if the list already had entries, you could not tell which duplicates were new.

The report gives only the request method and path, a POST to /widgets. It shows no parameters, headers, cookies or body, so there is nothing more to reproduce from it.

Step 1: Prepare a clean account

The researcher logged into a normal user account on jobs.target.com and made sure the "Saved Jobs" list was empty. This gives a clean baseline: anything that appears afterwards came from the test.

Step 2: Capture the save request

The researcher browsed the job listings, found an unsaved job, turned on interception in Burp Suite, and clicked the heart/save control. Interception means Burp holds the outgoing request before it reaches the website, so the tester can look at it and decide what to do. The captured request was sent to Repeater, and all remaining requests were dropped. Dropping them cancelled the like action itself, so it never reached the server. What remained was the save request sitting in Repeater, ready to be sent deliberately.

The application sent a POST request to the /widgets endpoint. A POST is one of the standard ways a browser talks to a server: it is used when the browser is sending data that should change something on the server, as opposed to simply asking for a page. An endpoint is a specific address on the server that accepts a particular kind of request, like a counter in a shop that handles one service. The report gives no further detail about this request.

Step 3: Duplicate the request

The exact same request was copied into 7 identical Repeater tabs. The point is to have seven copies of one action ready to fire, so that they can be released together rather than one after another.

Step 4: Send the group in parallel

Beside the Repeater tabs there is a "+" icon. The researcher clicked it, chose "Create tab group", ticked all the tabs and clicked create, which placed all 7 tabs into a single group. On the tabs group, the dropdown was opened, "Send group in parallel (single-packet attack)" was selected, and "send group (parallel)" was clicked.

Sending in parallel means the requests leave together instead of in a queue. The single-packet attack option is Burp's way of getting them to the server as close to simultaneously as the network allows, which is exactly the condition the suspected flaw needs.

Dropdown on the tabs group From the original on medium.com

Dropdown on the tabs group

From the original on medium.com
Results (Duplicated Saved jobs)

Results (Duplicated Saved jobs)

Step 5: Check that the duplicates are real

After firing the grouped requests, the researcher went back to the Job Cart / saved-jobs page and refreshed it. The same job appeared multiple times in the saved jobs list.

A page can show something twice because of a display bug rather than because the server really stored it twice, so the researcher refreshed several times. The duplicates stayed. As a further check, deleting one of the duplicates removed only that specific entry, while the other copies stayed in the account. That is the important part: removing one and leaving the rest suggests they are separate records in the backend.

Why it happened

The report describes the mechanism as a TOCTOU race: the existence check and the insert are not atomic with respect to each other. Atomic here means all-or-nothing, done as one indivisible step, so that nothing can slip in between. Because they are separate steps, concurrent requests all pass the check before any insert lands.

What it does establish is that no effective defence was in place: the parallel requests produced persistent duplicate records, and deleting one left the rest untouched.

Impact

By exploiting this race condition, an attacker, or indeed a normal user, can fire concurrent save requests for the same job and cause persistent duplicate records. This breaks the idempotency of the save/favourite workflow and corrupts the integrity of the database state for the user's account. Data integrity here means the stored data stays correct and consistent with what it is supposed to represent.

The effect is scoped to the acting user's own account in the described test. The report does not demonstrate cross-user impact, resource exhaustion at scale, or any downstream effect on other features, and it does not claim them.

Fix

The report does not say what was changed, if anything, and the issue was closed as out of scope.

Other places to try the same test

The takeaway the author draws is that state-changing endpoints beyond payments and coupons are worth testing this way: "Add to Cart", "Save Job" and "Follow User" are all prone to concurrent execution flaws. Concretely, on another target:

  1. Identify a create-style action that should be unique per user, such as saving, favouriting, following or adding to a cart.
  2. Capture the request once, duplicate it into several Repeater tabs, group them and send the group in parallel with the single-packet attack option.
  3. A positive result looks like the same item appearing multiple times after a refresh, with each copy behaving as an independent record, for example deleting one leaves the others in place.

Glossary

  • Bug bounty programme: a scheme where a company invites outside researchers to report security problems, sometimes for a reward.
  • HackerOne: a platform where bug bounty programmes are run and reports are submitted.
  • N/A (Out of Scope): a report closed because the issue falls outside the rules of the programme, so no reward or rating applies.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • POST: a request method used when the browser sends data that should change something on the server.
  • Request: a message a browser or tool sends to a server asking it to do something.
  • Server: the computer that runs the website and stores its data.
  • Database: the organised store where the server keeps records such as saved jobs.
  • Idempotency: the property that repeating an action leaves things in the same state as doing it once.
  • Race condition: a flaw where the result depends on the timing of actions that happen at the same time.
  • TOCTOU (Time-of-Check to Time-of-Use): a flaw caused by the gap between checking something and acting on that check.
  • Atomic: done as one indivisible step, so nothing can happen in between.
  • Uniqueness constraint: a database rule that refuses to store a second record matching an existing one.
  • Data integrity: the property that stored data stays correct and consistent.
  • Burp Suite Professional: a tool security testers use to watch, hold, edit and resend traffic between a browser and a website.
  • Repeater: the part of Burp where a single request can be held and sent again as often as needed.
  • Interception: Burp holding an outgoing request before it reaches the website so the tester can inspect it.
  • Tab group: a Burp Repeater feature that collects several tabs so they can be sent together.
  • Single-packet attack: Burp's option for sending grouped requests as close to simultaneously as the network allows.
  • Parallel: sent together rather than one after another.
  • Backend: the server-side systems, including the database, as opposed to what the browser displays.
  • Front-end desynchronisation: a display problem where the page shows something different from what the server actually stored.

More by coolorangee3

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.