Stopping bots bothers some honest buyers too
600 rice cookers at CGM. 2,866 people and 2,597 bots arrive in the same 40 seconds. A load test on a laptop, replayed second by second, with the defense off and on.
Where the last two pages stopped
The view checker let through bots that used a new name for every view: 2,400 of 11,400 bot views. The concert seats punished an identity that kept letting holds expire. Both rules count per identity, and a new identity costs a bot nothing. What is harder to make new: the device, the network, and how fast someone moves.
Defense
- Bought by a person
- Bought by a bot
- Still on the shelf
In the shadow queue: 0 bots, 0 people.
Before the doors open
The doors open at second 5. Bots are already in line, and each of them can come back as someone new.
- To people
- To bots
Who shows up
- Regular buyers Own phone or laptop, home network, reads the page for a few seconds. 5% use a VPN.
- Campus network Own laptops, but everyone shares the campus network.
- Computer lab, identical PCs Two labs, three PC images each, so many people share one device fingerprint.
- Fast clickers Press Queue under 1.5 s after the page loads and Buy within 0.45 s of their turn.
- Script bot A plain HTTP script from a hosting provider. No browser, a new identity every time.
- Bot farm Headless browsers behind home proxies, five device fingerprints, solves puzzles on a server.
- Stealth bot A new identity and fingerprint every time, home proxies, waits like a person, solves puzzles.
Who got a rice cooker
| Arrived | Got one, off | Got one, on | Bothered, on | |
|---|---|---|---|---|
| Regular buyers | 1,749 | 53 | 295 | 31 |
| Campus network | 399 | 31 | 85 | 0 |
| Computer lab, identical PCs | 319 | 23 | 47 | 99 |
| Fast clickers | 399 | 60 | 105 | 107 |
| Script bot | 1,199 | 213 | 0 | 460 |
| Bot farm | 1,199 | 206 | 25 | 453 |
| Stealth bot | 199 | 14 | 43 | 0 |
Bothered counts each identity once: a puzzle in the queue, a puzzle at checkout, or the shadow queue. Many arrivals never reached the check, because the queue was full or the stock was gone.
Who gets bothered, and why
Computer lab: identical PCs look like one device used by many names. 99 of 100 who reached the check got a puzzle, and 46 of them still bought one.
Fast clickers: pressing Buy within 0.4 s of your turn is what a bot does. 107 got a puzzle, and 88 still bought one.
Regular buyers on a VPN arrive from data-center addresses, because that is where VPNs run. 20 solved a puzzle. 11 landed in the shadow queue, because many VPN users came from one network at the same time.
The campus network alone was never enough: a busy network adds 20 points, and the puzzle starts at 30.
What it costs, and who pays
For a bot on a server, one 16-bit puzzle takes about 17 ms of CPU. A solving service sells Cloudflare Turnstile answers at about US$1.20 to US$1.45 per 1,000.
For a person, the same puzzle takes longer on a phone. In the load test we assumed 0.5 to 3 seconds. Try it on yours.
For the shop, every check is one more lookup in the queue's memory. On this busy laptop the check's p95 was about 0.7 ms. Turnstile itself is free, with no limit on checks.
Move the thresholds
A lower bar stops more bots and bothers more people. These bars are recomputed from the signals recorded in the run with the defense on. Who finally buys is not recomputed.
- Puzzle
- Shadow queue
The bot that gets through
The stealth bot got 43 with the defense on, more than the 14 it got without it, because the bots it was racing were stopped. None of the five signals tells it apart from a person: it has its own fingerprint, a home network and human timing, and it pays the puzzle in milliseconds. Catching it takes history (accounts, payment cards) or a limit per real person (ID checks, verified fan lists), which this shop does not have.
Every check also leans on the queue's memory (Redis). If it slows down, the queue stops. That is the next experiment: what fails, and how gracefully.
Show the technical side
Signals and weights
The score is the sum of the weights that fire. 30 or more gets a puzzle, 60 or more goes to the shadow queue. At checkout the most anyone gets is a puzzle, so a person who has been called is never moved quietly. Counts are first checks at the queue in the run with the defense on.
| Signal | Weight | Regular buyers | Campus network | Computer lab, identical PCs | Fast clickers | Script bot | Bot farm | Stealth bot |
|---|---|---|---|---|---|---|---|---|
| No device fingerprint (no JavaScript ran) | 50 | 0 | 0 | 0 | 0 | 460 | 0 | 0 |
| Fingerprint reports webdriver or headless | 60 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Address in a data-center range | 40 | 31 | 0 | 0 | 0 | 460 | 0 | 0 |
| Fingerprint used by 6 to 20 identities | 30 | 0 | 0 | 69 | 0 | 0 | 75 | 0 |
| Fingerprint used by more than 20 identities | 50 | 0 | 0 | 1 | 0 | 0 | 353 | 0 |
| More than 30 queue joins from one /24 in 10 s | 20 | 11 | 72 | 40 | 0 | 390 | 0 | 0 |
| Joined the queue under 1 s after the page loaded, or never loaded it | 30 | 0 | 0 | 0 | 66 | 460 | 453 | 0 |
| Pressed Buy under 400 ms after being told it was their turn | 40 | 0 | 0 | 0 | 85 | 0 | 25 | 0 |
Flow
- Loading the shop gets a signed page token with its time (GET /api/jaga/halaman).
- POST /api/antre: rate limit, then one Lua script adds the identity to its fingerprint's set, counts joins per /24 in a 10 s window, and reads when this ticket was told it was called. Go adds up the score.
- Medium: 428 with a challenge t1.<expiry>.<bits>.<random>.<HMAC over identity>. The client finds a nonce so that SHA-256(challenge:nonce) starts with that many zero bits and retries with X-Tantangan and X-Nonce. The answer is single-use (SET NX until the challenge expires).
- High: a shadow ticket signed like a real one. Polling it returns a fixed position until stock runs out. It never enters the real queue, so it takes nothing from people.
- POST /api/beli runs the same check without the queue-join count, and caps the level at a puzzle.
- The k6 group header is read only after the decision, for measurement.
Two alternating runs
| Off | Off, rerun | On | On, rerun | |
|---|---|---|---|---|
| Rice cookers to bots | 433 | 432 | 68 | 64 |
| Rice cookers to people | 167 | 168 | 532 | 536 |
| People bothered | 0 | 0 | 237 | 234 |
| Sold out, seconds after opening | 22 | 22 | 24 | 23 |
| Laptop CPU before / after, % | 70 / 100 | 100 / 100 | 46 / 85 | 62 / 81 |
| Request p95, median per second, ms | 0.94 | 1.14 | 1.53 | 1.89 |
| Check p95, median per second, ms | - | - | 0.73 | 0.65 |
Laptop CPU was high around every run, so the two latency rows are not a measurement of the defense. Who got a rice cooker is the same in both runs.
Puzzle cost
Go on one core of a AMD Ryzen 5 5500: 4,809,882, 3,740,465, 3,807,390 hashes per second (median 3,807,390), measured with laptop CPU at 0%. A quieter run of the same benchmark earlier gave 7.1 million. A 16-bit puzzle needs 65,536 hashes on average.
Turnstile and this puzzle
- Cloudflare Turnstile is free with unlimited checks, works on any site without Cloudflare in front, and its tokens last 300 s and are single-use.
- In automation it only accepts test keys that always pass or always fail, and Playwright and Selenium are detected as bots. A load test with it measures nothing, so the lab uses its own puzzle.
- Solving services sell Turnstile answers at US$1.20 to US$1.45 per 1,000 (2Captcha, CapSolver, Nov 2026). In Searles et al., USENIX Security 2023, 1,400 people took 3 to 43 seconds per CAPTCHA, while bots in earlier studies solved 85 to 100% of them, mostly faster.
Sources
- OWASP OAT-005 Scalping
- Searles et al., An Empirical Study & Evaluation of Modern CAPTCHAs, USENIX Security 2023
- Cloudflare, bot scores
- Cloudflare, Turnstile testing
- Cloudflare, bots in Waiting Room
- Queue-it, how 8.3 million ticket bots were blocked
- Ticketmaster, how the queue works
- FTC v. Live Nation and Ticketmaster, Sep 2025
- 2Captcha pricing
- Anubis, how it works
Code: api/internal/jaga (score, puzzle, checker), api/internal/server/jaga.go, k6/bot.js, scripts/rekam-bot.mjs. Decision record: docs/decisions/0012-bot-defense.md. Research: docs/riset/10-bot.md.