Race Condition in Coupon Application
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.
This hack was reported with no reward
Learn to find this bug
A real hack, reproduced for you to practice.
Create your account and practice real bugs that got paid. Download the environment, find it and learn the exact technique — your path to your first bounty.
hunters training
labs from real hacks
completions
paid out for these bugs
Access to all labs · no commitment · cancel anytime
Hackers who solved it· 8
Objectives
Achievement you'll earn
Solve this lab to unlock this shareable achievement

Community writeups
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
- Usar transacciones atomicas en la base de datos
- SELECT FOR UPDATE para bloquear la fila
- Optimistic locking con version numbers
- Rate limiting por usuario + recurso
