EntornosRankingComunidadWriteupsPreciosGorka
Entrar
  1. Home
  2. Environments
  3. Race Condition in Coupon Application

Race Condition in Coupon Application

MediumOriginalNo flag

E-commerce donde el endpoint de aplicar cupon tiene un delay entre verificar si ya fue usado y aplicarlo, permitiendo aplicar el mismo cupon multiples veces con peticiones concurrentes hasta que el precio llegue a 0. No flag: you mark it as completed when you're done.

Race Condition
Log in to startSee the environment

2,303 views · 28 completed · updated Nov 2026

Access

Learn to find this bug

An environment built to train this technique, step by step.

Create your account and practise with real hacks. Download the environment, find the bug and learn the exact technique.

hunters training

hacking environments

environments solved

paid out for these bugs

Create account
I already have an account

Access to all environments · cancel the renewal anytime and keep what you paid for

Information

Difficulty
Medium
Duration
25 min
Bounty
Not applicable
Completed
28
Creator
@gorka
Updated
Nov 2026

The environment

ZIP with the environment and its autodeploy

You download it from here. Inside there's the environment and two scripts that start it for you, one per system.

autodeploy.shautodeploy.ps1
Create an account to download it

Only requirement: Docker

Nothing else. The autodeploy builds and starts the environment for you.

Autodeploy · one command

Linux and macOS

$./autodeploy.sh

Windows

PS>.\autodeploy.ps1

From inside the folder the ZIP creates. It prints the URL and credentials.

Objectives · the path, not the solution

  1. 01Crear un pedido y observar el flujo de cupones
  2. 02Identificar el endpoint POST /api/orders/:id/apply-coupon
  3. 03Enviar 20+ peticiones concurrentes para aplicar el mismo cupon
  4. 04Verificar que el precio se redujo a 0

Prerequisites

  • Concepto de Race Condition (TOCTOU)
  • Herramientas para peticiones concurrentes

Tools

  • Burps Suite

Latest to solve it

  • @zuk4r119 days ago
  • @l3g10n_Oct 2026
  • @r00thorOct 2026
  • @sharat chandraOct 2026
  • @emperadorSep 2026
  • @bizedtvSep 2026
  • @3nk1Sep 2026
  • @blackcloudsecurityAug 2026

The badge

Achievement you'll earn

Solve this environment to unlock this shareable achievement

Solve this environment to unlock this shareable achievement

Community writeups

Free · no account

The checklist I run on every new target

47 checks ordered by cost: first what can get you in trouble, then the cheap stuff, and finally the expensive stuff — which is where the big bounties are. I'll send it to your inbox right now.

Unsubscribe in one click, from any email.

Despliegue

# Opcion 1: autodeploy
./autodeploy.sh

# Opcion 2: manual
docker compose up --build

# Acceder
https://localhost:1000

Compatible con macOS, Linux y Windows (Docker Desktop / WSL).

Para parar:

./autodeploy.sh destroy
# o: docker compose down -v

Contenido del Lab

La aplicacion

ShopZone es un e-commerce con cupones de descuento que se aplican a pedidos.

La vulnerabilidad

El endpoint verifica si el cupon ya fue aplicado, luego aplica el descuento con un delay artificial entre ambas operaciones. Peticiones concurrentes pasan la verificacion antes de que ninguna haya completado la aplicacion.

Cadena de ataque

1. Crear pedido (ej: 100 euros)
2. Obtener cupon de 20 euros
3. Lanzar 20+ peticiones concurrentes de aplicar cupon
4. Todas pasan el check al mismo tiempo
5. Cupon aplicado multiples veces\n6. Precio final: 0 euros

Solucion interactiva

Accede a /writeup dentro de la aplicacion para una guia paso a paso con botones interactivos.


Flag

(precio del pedido reducido a 0 euros)

Remediacion

  1. Usar transacciones atomicas en la base de datos
  2. SELECT FOR UPDATE para bloquear la fila
  3. Optimistic locking con version numbers
  4. Rate limiting por usuario + recurso

The community

This isn't a platform with users.It's people breaking the same things you are.

Inside people ask, share what they found and solve together what would block anyone on their own. It's free to join: no account, no plan, no email required.

Join the Discord

Free and open. You don't need a BBLABS account to join.

Aprende hacking con entornos que replican hackeos reales.

Producto

  • Entornos
  • Hacker Roadmap
  • Arena · ranking
  • Precios
  • Empresas

Aprender

  • Aprender desde 0
  • Academy
  • Blog
  • Writeups
  • Crew · Discord

Más

  • Gorka
  • Términos
  • Privacidad
  • Cookies
  • team@bblabs.es
© 2026 BBLABS · Hecho en Españalabs.bblabs.escrew.bblabs.esacademy.bblabs.esarena.bblabs.esblog.bblabs.esbugbounty.bblabs.esteams.bblabs.es