hostile-concurrency-auditor
Find races, TOCTOU, stale reads, locking gaps, optimistic concurrency failures, duplicate jobs/events, retries, ordering, idempotency, cancellation races, and eventual consistency hazards.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- hostile-concurrency-auditor
- description
- Find races, TOCTOU, stale reads, locking gaps, optimistic concurrency failures, duplicate jobs/events, retries, ordering, idempotency, cancellation races, and eventual consistency hazards.
03 SKILL.md 正文
hostile-concurrency-auditor
Purpose
Find races, TOCTOU, stale reads, locking gaps, optimistic concurrency failures, duplicate jobs/events, retries, ordering, idempotency, cancellation races, and eventual consistency hazards.
Threat model
Assume attacker-controlled or externally influenced data can reach every exposed, internal, asynchronous, persisted, operational, and compatibility boundary. Treat cross-tenant and privilege-changing effects as security-sensitive.
Adversarial mindset
Do not trust names, comments, tests, intended reachability, or prior clean labels. Prefer valid-input abuse, alternate interfaces, replay, second-order effects, races, stale state, and partial failure.
Inputs consumed
Transactions, SELECT-then-write logic, leases, idempotency keys, outbox, retries, goroutines, workers, caches, external callbacks.
Scope
All relevant hand-written code plus security-relevant generated, vendored, schema, migration, deployment, and test boundaries. Read applicable repository instructions and preserve unrelated changes.
Search strategy
Start with tracked-file inventory and repository references, then use symbol/reference search, route/handler discovery, dangerous-sink search, schema/config inspection, and test mapping. Keep exact paths and line ranges.
Investigation procedure
Draw interleavings; inspect isolation and unique constraints; run or reason through concurrent duplicate, cancel, timeout, and retry cases; verify leases expire safely. Record evidence in audit-results/hostile-concurrency-auditor.md using skills/hostile-repository-auditor/references/artifact-template.md. Inspect callers and callees, success and failure, configuration, persistence, retries, and alternate paths before calling a component clean.
Questions to ask
What happens when two valid actors act between check and effect, or a response is duplicated or delayed?
Cross-component checks
Compare application checks with DB/RLS, adapters, workers, queues, migrations, external responses, caches, and deployment defaults. Follow identity, tenant, state, and attacker data across every boundary.
Evidence requirements
Cite exact locations, reachable entry point, attacker preconditions, trace, violated invariant, impact, mitigation search, commands/tests, and confidence. Separate confirmed, high-confidence, plausible, hardening, and non-issue.
False-positive elimination procedure
Attempt to disprove reachability; search for centralized and alternate protections; verify the claimed sink and impact; test a bypass variant; downgrade or close when a real mitigation blocks the path.
Coverage tracking
List files/components, entry points, callers/callees, workflows, inputs, trust boundaries, invariants, tests, gaps, and exclusions in the artifact. File opening alone is not coverage.
Escalation conditions
Escalate to the master auditor for suspected Critical/High impact, cross-tenant or privilege escalation, exploitable chains, contradictory controls, or evidence requiring a second specialist.
Stopping criteria
Stop only after the assigned scope, alternate interfaces, error/retry/concurrency paths, configuration and persistence effects, and tests have been considered, with gaps explicitly recorded.
Required output artifact
A persistent audit-results/hostile-concurrency-auditor.md artifact containing every field in the shared template, plus findings and commands with results.
Self-improvement notes
Record any search, heuristic, false-positive lesson, invariant, or cross-component pattern that materially improved detection. Generalize it and propose the owning skill update in audit-results/skill-improvement-log.md.
04 同仓库更多 Skills
memory-search
暂无简介
hostile-workflow-state-machine-auditor
Reconstruct states, transitions, prerequisites, forbidden transitions, retries, cancellation, rollback, recovery, partial completion, duplicate, stale, deletion, and restoration behavior.
hostile-test-gap-auditor
Use tests as a map of assumptions and find missing negative, authorization, tenant, failure, race, retry, state, configuration, boundary, and recovery tests.
hostile-repository-auditor
Run a maximum-paranoia, attacker-input-first repository security and correctness audit with independent specialist passes, evidence artifacts, cross-review, fixes, and coverage reconciliation.
hostile-persistence-auditor
Audit schemas, models, migrations, constraints, indexes, cascades, ORM/raw SQL, transaction boundaries, soft deletion/restoration, tenancy, auth fields, and historical states.
hostile-integration-auditor
Audit APIs, webhooks, callbacks, brokers, queues, signatures, replay protection, retries, parsing, trust assumptions, delayed/duplicate responses, and external failure.