/appsec:race-conditionsfrom appsec
Analyzes source code for race condition vulnerabilities including TOCTOU, double-spend, check-then-act, file system races, and shared state across async boundaries. Supports semgrep, go vet, and bandit scanners.
Ships in appsec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Analyze source code for race condition vulnerabilities including time-of-check to time-of-use (TOCTOU), double-spend, check-then-act without locking, file system race conditions, shared state across async boundaries, and non-atomic counter operations. Race conditions are among the hardest bugs to detect through testing because they depend on timing, making static analysis essential.
Read ../../shared/schemas/flags.md for the full flag specification. This skill
supports all cross-cutting flags. Key flags for this skill:
--scope determines which files to analyze (default: changed)--depth standard reads code and checks for common race patterns--depth deep traces shared state across call graphs and async boundaries--severity filters output (race conditions are often high or critical)Key CWEs in scope:
Read references/detection-patterns.md for the full catalog of code patterns,
search heuristics, language-specific examples, and false positive guidance.
Parse flags and resolve the file list per ../../shared/schemas/flags.md.
Filter to files likely to contain race-prone logic:
**/services/**, **/handlers/**, **/models/**)**/payments/**, **/billing/**, **/wallet/**)**/storage/**, **/upload/**, **/fs/**)**/workers/**, **/tasks/**, **/jobs/**)**/counters/**, **/state/**, **/cache/**)Detect scanners per ../../shared/schemas/scanners.md:
semgrep -- primary scanner for concurrency patternsgo vet -- Go-specific race detection heuristicsbandit -- Python threading and synchronization issuesRecord which scanners are available and which are missing.
If semgrep is available, run with rules targeting concurrency:
semgrep scan --config auto --json --quiet <target>
Filter results to rules matching race condition, TOCTOU, and concurrency patterns. Normalize output to the findings schema.
Regardless of scanner availability, perform manual code analysis:
When --depth deep, additionally trace:
Format output per ../../shared/schemas/findings.md using the RACE prefix
(e.g., RACE-001, RACE-002).
Include for each finding:
These are the high-signal patterns specific to race conditions. Each maps
to a detection pattern in references/detection-patterns.md.
TOCTOU in file operations -- Checking file existence or permissions then operating on the file in a separate call.
Double-spend / check-then-debit -- Reading a balance, comparing it, then debiting in separate non-atomic steps.
Check-then-act without lock -- Any pattern where a condition is checked and the result is assumed to hold when the action executes.
Shared state across await -- Reading mutable state, yielding execution (await/yield), then using the stale value.
Non-atomic read-modify-write -- Counter increments, sequence generators, or flag toggles without synchronization.
Missing database transaction isolation -- Financial operations using default (READ COMMITTED) isolation when SERIALIZABLE is needed.
Parallel iteration over shared collection -- Modifying a shared list, map, or set from concurrent goroutines, threads, or async tasks.
| Scanner | Coverage | Command |
|---|---|---|
| semgrep | TOCTOU file ops, non-atomic patterns | semgrep scan --config auto --json --quiet <target> |
| go vet | Go race condition heuristics | go vet -race ./... |
| bandit | Python threading issues | bandit -r <target> -f json -q |
Fallback (no scanner): Use Grep with patterns from references/detection-patterns.md
to find check-then-act patterns, file stat calls, counter operations, and
async state access. Report findings with confidence: medium.
Use the findings schema from ../../shared/schemas/findings.md.
RACE (e.g., RACE-001)race-conditionsspecializedRACECWE-362, CWE-367T (Tampering) or E (Elevation of Privilege)Severity guidance for this category:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
race-condition, toctou, concurrency, double-spend, security-analysis
62 skills in this plugin
/access-controlThis skill should be used when the user asks to "check for access control issues", "analyze authorization", "find IDOR vulnerabilities", "audit CORS configuration", "check for privilege escalation", or mentions "access control", "authorization", "IDOR", "CORS", "JWT tampering", or "directory traversal" in a security context. Maps to OWASP Top 10 2021 A01: Broken Access Control.
/apiThis skill should be used when the user asks to "check API security", "audit REST API", "find BOLA vulnerabilities", "check for mass assignment", "analyze API rate limiting", "detect excessive data exposure", or mentions "API security", "BOLA", "IDOR", "mass assignment", "rate limiting", "broken function-level authorization", "excessive data exposure", or "OWASP API Top 10" in a security context.
/npx claudepluginhub florianbuetow/claude-code --plugin appsecOther plugins' skills for the same job