Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)42k · #6445

competition-race-condition-state-drift

Skill này làm gì

Công cụ này giúp tái hiện các vấn đề xảy ra khi nhiều hành động diễn ra cùng lúc. Nó tập trung vào cách thứ tự và thời điểm của các hành động có thể gây ra lỗi bất ngờ, như dữ liệu sai hoặc hành động bị lặp lại.

Khi nào nên dùng

  • ✓Khi bạn nghi ngờ thứ tự các hành động đang gây ra lỗi.
  • ✓Để kiểm tra điều gì xảy ra nếu hai thứ cùng cố thay đổi một dữ liệu tại cùng thời điểm.
  • ✓Để hiểu cách các lỗi tạm thời có thể dẫn tới kết quả khác nhau.

Liên kết skill

https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn kiểm tra điều gì xảy ra nếu hai người cùng lúc rút tiền từ một tài khoản.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ xác định các phần của hệ thống có thể bị thay đổi (như dữ liệu trong cơ sở dữ liệu hoặc cache). Sau đó nó mô phỏng các hành động diễn ra đồng thời, chỉ thay đổi thứ tự hoặc thời điểm, để xem liệu có cho kết quả khác với mong đợi không.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. Identify mutable state first: rows, cache keys, queue payloads, session fields, counters, or files.
  2. Reproduce with smallest concurrent sequence and fixed timing assumptions.
  3. Capture one baseline run and one racing run with only one variable changed.
  4. Track read, check, write, enqueue, and commit boundaries separately.
  5. 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.md for 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
Câu hỏi thường gặp

“State” là gì?

State là thông tin mà hệ thống giữ tại một thời điểm nhất định, như số dư tài khoản ngân hàng hoặc trạng thái đơn hàng.

“Race condition” là gì?

Đây là vấn đề xảy ra khi kết quả của một thao tác phụ thuộc vào đúng thứ tự thực thi của nhiều hành động đồng thời.

Vì sao “thứ tự” lại quan trọng?

Trong các hệ thống có nhiều hành động diễn ra cùng lúc, thứ tự xử lý có thể thay đổi kết quả cuối cùng. Nếu không kiểm soát được thứ tự, lỗi có thể xảy ra.

Chi tiết

Mô tả gốc của tác giả

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

repo: zhaoxuya520/reverse-skill

Độ phổ biến

Sao GitHub
42k
Vị trí xếp hạng
#6445
Giấy phép
MIT
Cập nhật
22/9/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự