competition-race-condition-state-drift
它能做什么
这个工具帮助你复现多个操作同时发生时出现的问题。它关注的是操作的顺序和时机如何导致意外错误,比如数据不正确或操作被重复执行。
适用场景
- ✓当你怀疑是操作的顺序导致了错误时。
- ✓想测试两个东西同时修改同一份数据会发生什么时。
- ✓想了解临时故障如何导致不同结果时。
技能链接
https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想测试两个人同时从同一个账户取钱会发生什么。”
每周 5 个新技能,1 分钟读完。
工作原理
工具会先找出系统中可能被修改的部分(比如数据库或缓存中的数据)。然后模拟同时发生的操作,只改变它们的顺序或时机,看看是否会产生与预期不同的结果。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Competition Race Condition State Drift
Use this skill only as a downstream specialization after $ctf-sandbox-orchestrator is already active and has established sandbox assumptions, node ownership, and evidence priorities. If that has not happened yet, return to $ctf-sandbox-orchestrator first.
Use this skill when the decisive behavior depends on request timing, async ordering, lock gaps, or stale state.
Reply in Simplified Chinese unless the user explicitly requests English.
Quick Start
- Identify mutable state first: rows, cache keys, queue payloads, session fields, counters, or files.
- Reproduce with smallest concurrent sequence and fixed timing assumptions.
- Capture one baseline run and one racing run with only one variable changed.
- Track read, check, write, enqueue, and commit boundaries separately.
- Prove final state drift from a clean reset.
Workflow
1. Map Mutable Boundaries
- Record transaction scope, lock behavior, retry logic, idempotency keys, cache invalidation, and queue handoff.
- Note where read-check-write is split across requests, workers, or services.
- Keep each boundary tied to exact timestamps or sequence numbers.
2. Reproduce Timing Window
- Build deterministic concurrent inputs with controlled delay, duplicate requests, or reordered worker execution.
- Compare accepted and rejected paths under identical payloads.
- Record which condition flips when ordering changes.
3. Reduce To Decisive Race Chain
- Compress to: request A and B ordering -> stale check or lock gap -> conflicting writes -> resulting capability or artifact.
- State whether root cause is missing lock, weak idempotency, stale cache read, delayed async commit, or retry side effect.
- If the path becomes queue-dominant, hand off to queue worker drift skill.
Read This Reference
- Load
references/race-condition-state-drift.mdfor race harness ideas, evidence blocks, and parity checks.
What To Preserve
- Mutable keys, transaction boundaries, lock behavior, and idempotency markers
- Timestamped or sequenced traces for baseline and race runs
- One minimal replayable concurrent sequence proving drift
常见问题
什么是“状态”(state)?
状态是系统在某一时刻所保存的信息,比如银行账户的余额或订单的状态。
什么是“竞态条件”(race condition)?
它是指多个并发操作同时进行时,结果取决于这些操作执行的精确先后顺序,从而引发的问题。
为什么“顺序”很重要?
在有大量操作同时进行的系统中,这些操作被处理的先后顺序会改变最终结果。如果顺序得不到控制,就可能出错。
详情
作者的原始描述
Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for race windows, ordering bugs, idempotency failures, lock gaps, concurrent worker drift, and state inconsistencies that produce decisive effects. Use when the user asks to reproduce timing-sensitive bugs, concurrent state corruption, duplicate actions, stale reads, or privilege or balance drift caused by request orderin
热度
- GitHub 星标
- 42k
- 排名
- #6445
- 许可证
- MIT
- 更新时间
- 2026/9/22
评论
- …
同一仓库的更多技能
competition-ad-certificate-abuse
42k帮你的智能体分析针对数字证书系统的攻击。它会研究证书可能如何被滥用来获取访问权限。
competition-agent-cloud
42k帮你的智能体分析 AI 和云系统中的安全问题。它会研究提示词、工具和云端可能如何被利用。
competition-android-hooking
42k帮你的智能体研究 Android 应用。它会分析应用的内部运行方式,以及可能如何被修改或利用。
competition-browser-persistence
42k帮你的智能体分析网站如何在浏览器中存储信息。它会研究 Cookie 等数据,以理解会话是如何运作的。