BOT PROTECTION FOR TICKETING

Queue Position Integrity: Signed Tokens Beat Guessable URLs

If queue position lives in a URL parameter or a sequential cookie, it will be edited. Signed tokens make position tamper-evident, and the difference decides whether your queue is a queue.

A waiting room controls fairness only if a visitor cannot manufacture a better position. Position stored as a plain URL parameter, a sequential ID, or an unsigned cookie can be edited or guessed. The robust pattern is a server-issued signed token, an HMAC over the session and position data with a short expiry, verified on every request, so tampering invalidates the token instead of improving the place in line.

The attack is a text editor

Early waiting room implementations, and plenty of home-grown ones still, carry position in the open: a query parameter, a readable cookie, a JSON blob in local storage. The attack requires no skill at all. Open dev tools, change the number, reload, arrive at the front. Slightly harder variants guess the pattern of entry URLs and poll them directly, skipping the queue page entirely. If your fairness story depends on visitors not looking at their own browser state, you do not have a fairness story.

Cloudflare's Waiting Room documentation describes the managed version of the fix: the platform controls admission with its own cookies and validation, so the client's stored state is not the authority. Queue-it's fairness guidance makes the same architectural point for its product. Authority has to live server-side, with the client holding only a token the server can verify.

What a signed token actually proves

Sign the payload that matters: an opaque session identifier, the queue identifier, the issue time, and an expiry, using HMAC with a server secret. Verification on each request proves the token was issued by you and not altered, because any edit breaks the signature. Pair it with server-side position state so a replayed token from a finished session cannot be reused, and rotate or expire tokens on admission. None of this is exotic cryptography; it is the same pattern as a signed session cookie, applied to a place in line.

Be clear about what it does not prove. A signed token stops tampering and guessing. It does not stop one person from legitimately holding many sessions, which is the randomized entry fairness problem, nor bots that queue politely and behave until admitted, which is a bot management problem. Teams conflate these constantly and then declare the queue broken when a control designed for tampering fails to stop Sybil entries. Different attacks, different controls.

Expiry is a fairness feature

Short token lifetimes do quiet work. They bound how long a position can be hoarded, shared, or sold, and they force abandoned sessions out of the count that decides admission rates. The inventory hold timeout piece covers the same logic one step later in the journey: a claim on scarce stock, or a place in line, that never expires is a claim that will be abused or wasted. Set token expiry with the drop's real rhythm, minutes for a fast release, and pair it with a visible countdown so honest visitors are not surprised by a rule that exists to stop dishonest ones.

Frequently asked questions

Why are URL parameters a bad place to store queue position?

Because visitors can edit them. Any position value the client can read and change will be changed. Position must be authoritative on the server, with the client holding only a verifiable token.

What should a queue token contain?

An opaque session ID, the queue ID, issue time, and expiry, signed with an HMAC using a server secret. The signature makes edits detectable; server-side state makes replays useless.

Does a signed token stop bots joining the queue?

No. It stops tampering and URL guessing. Multiple legitimate-looking sessions and well-behaved bots are separate problems handled by bot checks and entry design, not token signing.

How long should a queue token live?

Minutes, matched to the pace of the release. Short lifetimes stop position hoarding and link sharing, and clear abandoned sessions out of the admission count.