Skip to content
Race condition Write-up Intermediate

Race Condition to Break Business Logic & Trap an Organization For

The application prevented the last administrator from leaving an organisation, but two simultaneous requests (one to leave, one to demote the other administrator) were each validated against the same pre-race state. This let the attacker reach a state where the organisation had no administrator, which the business logic was designed to prevent.

mo7med elta7an Follow

Published on medium.com

During one of my Bug Bounty hunting sessions, I wasn't looking for a specific vulnerability.

mo7med elta7an, 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.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the server validated the 'last administrator' rule and then updated membership state in separate, non-atomic steps, so concurrent requests both passed validation against the same stale state.

Impact

An attacker could leave an organisation without an administrator, breaking the business rule that requires at least one administrator to remain.

What the attacker needed

An account in the organisation; ability to invite and promote a user; ability to send requests concurrently

How it was found

  1. Invite another user and promote them to Administrator.
  2. Identify the leave-organisation request and the demote-administrator request.
  3. Send both requests simultaneously using a race condition technique.
  4. Observe that the application reaches a state with no administrator, which its business logic prevents.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A race condition happens when a program checks a rule and then changes something, but another request can slip in between the check and the change. Here, the server checked that an administrator was not the last one, but two requests did that check at the same moment, so both passed. The result was an organisation with no administrator, a state the application meant to forbid.

What is Race condition?

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

More by mo7med elta7an

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.