Skip to content

Field manual · BAC · Chapter 7

Race Conditions as BAC

Vertical via timing

1 min readBroken Access Control

Chapter 7: race conditions as BAC: vertical via timing

Section titled “Chapter 7: race conditions as BAC: vertical via timing”

Why care: a role check that is correct at rest can still be beaten by firing requests faster than the write that enforces it. Sometimes the authorization is there, but only eventually:

NORMAL SEQUENTIAL REQUESTS (SAFE) Req 1: READ role=admin COMMIT: role=demoted Req 2: READ role=demoted (403) HTTP/2 SINGLE-PACKET PARALLEL BURST (TOCTOU WINDOW) RACE WINDOW (~5-30 ms) All threads read stale state before first write commits SELECT -> ALLOW x N Req #1 (last byte held) Req #2 (last byte held) Req #20 (released at once) MULTIPLE 200 OK RESPONSES One-time coupon applied 5x, balance overdrawn, or admin action runs post-demotion
Figure 1 Holding the final byte of 20 HTTP/2 requests and releasing them in one TCP packet removes network jitter so every thread enters the check-then-act window together.

7.1 Role-change TOCTOU (time-of-check/time-of-use)

Section titled “7.1 Role-change TOCTOU (time-of-check/time-of-use)”
1. Open two parallel browser windows: one as a standard user, one mid-upgrade
2. The standard-user account clicks "Upgrade to admin" and immediately fires N
parallel requests to /admin/users in the same instant
3. A request lands before the role-write commits, so it is processed as
"already admin"

Turbo Intruder, or simplest version: fire 30 parallel curls with &:

Terminal window
for i in $(seq 30); do curl -s -o /dev/null -w "%{http_code}\n" \
-b "$ADMINISH_SESSION" https://target.com/admin/users & done

7.2 Downgrade-race (downgrade-detection bug)

Section titled “7.2 Downgrade-race (downgrade-detection bug)”
Admin gets demoted. Between "admin" and "demoted" — the app kills active sessions... eventually.
If old admin-session tokens work for a window (or forever) → persistent privileged access
after role loss. This is a *report-worthy* category: "former employees retain admin access" is a consultant's favorite finding.

These are 30-curl-loop demonstrations. The verified single-packet procedure wins tight races. It uses HTTP/2 request concatenation and Turbo Intruder’s race engine. See the race-condition chapter in Bug Hunting for Beginners.

Next step: Chapter 8 rounds up the exotic biomes where BAC hides, debug flags, mobile-only APIs, and multi-tenant boundaries.

Connections1 backlink · 1 outgoing · 1 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

Broken Access ControlFor authorized security research only: bug bounty programs, your own systems, or scoped engagements with written permission.