competition-race-condition-state-drift
できること
このツールは、複数の処理が同時に起きたときに発生する問題を再現するのに役立ちます。処理の順番やタイミングによって、誤ったデータや重複した処理といった予想外のエラーがどのように起きるかに注目します。
使う場面
- ✓処理の順番がエラーの原因になっていると疑うとき。
- ✓2つの処理が同じデータを同時に変更しようとするとどうなるかを検証したいとき。
- ✓一時的な失敗によって結果が変わってしまう仕組みを理解したいとき。
スキルのリンク
https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“同じ口座から2人が同時にお金を引き出そうとしたら何が起きるかを検証したいです。”
毎週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
よくある質問
「状態(ステート)」とは何ですか?
システムがある時点で保持している情報のことです。銀行口座の残高や注文の状況などが例にあたります。
「レースコンディション」とは何ですか?
複数の処理が同時に実行されるとき、結果が処理の正確な順番に依存してしまう問題のことです。
なぜ「順番」が重要なのですか?
多くの処理が同時に行われるシステムでは、処理される順番によって最終的な結果が変わることがあります。順番を制御しないと、エラーが起きる可能性があります。
詳細
作者による元の説明
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エージェントが、Webサイトがブラウザ内に情報を保存する仕組みを分析する手助けをします。Cookieなどのデータを調べ、セッションの仕組みを理解します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。