Skip to content
Race condition Write-up Intermediate

Privilege escalation mediante Race Condition.

A user with limited permissions could create a role with the highest privilege and assign it to a team, but the application blocked adding a user to that team while the privileged role was attached. By sending the three actions in parallel, the checks raced and the user gained System Administrator rights; on the SaaS version, this allowed changing the licence and then running operating system commands.

duality084 Follow

Published on medium.com

La idea de este post es contar los detalles técnicos de una vulnerabilidad que encontré recientemente en un programa de BugBounty, se trata de mi 3er vulnerabilidad encontrada, que clasificó como P1 en Bugcrowd y por la cual obtuve mi primer bounty de 4 cifras. El tipo de vulnerabilidad detallada a continuación es del…

Matias Ramirez, 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 a time-of-check to time-of-use flaw: the application validated team membership and role assignment separately, without locking, so concurrent requests bypassed the restriction.

Impact

An attacker with limited permissions could gain System Administrator rights; on the SaaS version, this allowed changing the licence and then executing operating system commands, which exposed database credentials and revealed a Kubernetes cluster.

What the attacker needed

A user account with permission to edit users, roles and…; ability to send requests in parallel

How it was found

  1. Create a new user role and assign it the System Administrator privilege.
  2. Create a new team and assign the new role to it.
  3. Try to add a user to the team; the application returns an error.
  4. Remove the role from the team and confirm the user can be added.
  5. Send three requests in parallel: add user to team, add role to team, and grant System Administrator to the role.
  6. Observe that all requests succeed and the user gains System Administrator rights.

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 something and then acts on it, but another action slips in between the check and the action. Here, the program checked whether a team had a powerful role before adding a user, but by sending the add-user request at the same moment as the role assignment, the check passed before the role was attached. The result was that a normal user ended up with the highest permissions.

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.

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.