strix-agent 0.1.18__py3-none-any.whl → 0.1.19__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of strix-agent might be problematic. Click here for more details.

Files changed (40) hide show
  1. strix/agents/StrixAgent/strix_agent.py +2 -1
  2. strix/agents/StrixAgent/system_prompt.jinja +8 -10
  3. strix/agents/base_agent.py +20 -0
  4. strix/agents/state.py +18 -1
  5. strix/cli/app.py +92 -15
  6. strix/cli/main.py +3 -2
  7. strix/cli/tool_components/base_renderer.py +2 -2
  8. strix/cli/tool_components/reporting_renderer.py +2 -1
  9. strix/prompts/README.md +64 -0
  10. strix/prompts/__init__.py +1 -1
  11. strix/prompts/cloud/.gitkeep +0 -0
  12. strix/prompts/custom/.gitkeep +0 -0
  13. strix/prompts/frameworks/fastapi.jinja +142 -0
  14. strix/prompts/frameworks/nextjs.jinja +126 -0
  15. strix/prompts/protocols/graphql.jinja +215 -0
  16. strix/prompts/reconnaissance/.gitkeep +0 -0
  17. strix/prompts/technologies/firebase_firestore.jinja +177 -0
  18. strix/prompts/technologies/supabase.jinja +189 -0
  19. strix/prompts/vulnerabilities/authentication_jwt.jinja +133 -115
  20. strix/prompts/vulnerabilities/broken_function_level_authorization.jinja +146 -0
  21. strix/prompts/vulnerabilities/business_logic.jinja +146 -118
  22. strix/prompts/vulnerabilities/csrf.jinja +137 -131
  23. strix/prompts/vulnerabilities/idor.jinja +149 -118
  24. strix/prompts/vulnerabilities/insecure_file_uploads.jinja +188 -0
  25. strix/prompts/vulnerabilities/mass_assignment.jinja +141 -0
  26. strix/prompts/vulnerabilities/path_traversal_lfi_rfi.jinja +142 -0
  27. strix/prompts/vulnerabilities/race_conditions.jinja +135 -165
  28. strix/prompts/vulnerabilities/rce.jinja +128 -180
  29. strix/prompts/vulnerabilities/sql_injection.jinja +128 -192
  30. strix/prompts/vulnerabilities/ssrf.jinja +118 -151
  31. strix/prompts/vulnerabilities/xss.jinja +144 -196
  32. strix/prompts/vulnerabilities/xxe.jinja +151 -243
  33. strix/tools/agents_graph/agents_graph_actions.py +4 -3
  34. strix/tools/agents_graph/agents_graph_actions_schema.xml +10 -14
  35. strix/tools/registry.py +1 -1
  36. {strix_agent-0.1.18.dist-info → strix_agent-0.1.19.dist-info}/METADATA +52 -13
  37. {strix_agent-0.1.18.dist-info → strix_agent-0.1.19.dist-info}/RECORD +40 -27
  38. {strix_agent-0.1.18.dist-info → strix_agent-0.1.19.dist-info}/LICENSE +0 -0
  39. {strix_agent-0.1.18.dist-info → strix_agent-0.1.19.dist-info}/WHEEL +0 -0
  40. {strix_agent-0.1.18.dist-info → strix_agent-0.1.19.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,142 @@
1
+ <path_traversal_lfi_rfi_guide>
2
+ <title>PATH TRAVERSAL, LFI, AND RFI</title>
3
+
4
+ <critical>Improper file path handling and dynamic inclusion enable sensitive file disclosure, config/source leakage, SSRF pivots, and code execution. Treat all user-influenced paths, names, and schemes as untrusted; normalize and bind them to an allowlist or eliminate user control entirely.</critical>
5
+
6
+ <scope>
7
+ - Path traversal: read files outside intended roots via ../, encoding, normalization gaps
8
+ - Local File Inclusion (LFI): include server-side files into interpreters/templates
9
+ - Remote File Inclusion (RFI): include remote resources (HTTP/FTP/wrappers) for code execution
10
+ - Archive extraction traversal (Zip Slip): write outside target directory upon unzip/untar
11
+ - Server/proxy normalization mismatches (nginx alias/root, upstream decoders)
12
+ - OS-specific paths: Windows separators, device names, UNC, NT paths, alternate data streams
13
+ </scope>
14
+
15
+ <methodology>
16
+ 1. Inventory all file operations: downloads, previews, templates, logs, exports/imports, report engines, uploads, archive extractors.
17
+ 2. Identify input joins: path joins (base + user), include/require/template loads, resource fetchers, archive extract destinations.
18
+ 3. Probe normalization and resolution: separators, encodings, double-decodes, case, trailing dots/slashes; compare web server vs application behavior.
19
+ 4. Escalate from disclosure (read) to influence (write/extract/include), then to execution (wrapper/engine chains).
20
+ </methodology>
21
+
22
+ <discovery_techniques>
23
+ <surface_map>
24
+ - HTTP params: file, path, template, include, page, view, download, export, report, log, dir, theme, lang
25
+ - Upload and conversion pipelines: image/PDF renderers, thumbnailers, office converters
26
+ - Archive extract endpoints and background jobs; imports with ZIP/TAR/GZ/7z
27
+ - Server-side template rendering (PHP/Smarty/Twig/Blade), email templates, CMS themes/plugins
28
+ - Reverse proxies and static file servers (nginx, CDN) in front of app handlers
29
+ </surface_map>
30
+
31
+ <capability_probes>
32
+ - Path traversal baseline: ../../etc/hosts and C:\\Windows\\win.ini
33
+ - Encodings: %2e%2e%2f, %252e%252e%252f, ..%2f, ..%5c, mixed UTF-8 (%c0%2e), Unicode dots and slashes
34
+ - Normalization tests: ....//, ..\\, ././, trailing dot/double dot segments; repeated decoding
35
+ - Absolute path acceptance: /etc/passwd, C:\\Windows\\System32\\drivers\\etc\\hosts
36
+ - Server mismatch: /static/..;/../etc/passwd ("..;"), encoded slashes (%2F), double-decoding via upstream
37
+ </capability_probes>
38
+ </discovery_techniques>
39
+
40
+ <detection_channels>
41
+ <direct>
42
+ - Response body discloses file content (text, binary, base64); error pages echo real paths
43
+ </direct>
44
+
45
+ <error_based>
46
+ - Exception messages expose canonicalized paths or include() warnings with real filesystem locations
47
+ </error_based>
48
+
49
+ <oast>
50
+ - RFI/LFI with wrappers that trigger outbound fetches (HTTP/DNS) to confirm inclusion/execution
51
+ </oast>
52
+
53
+ <side_effects>
54
+ - Archive extraction writes files unexpectedly outside target; verify with directory listings or follow-up reads
55
+ </side_effects>
56
+ </detection_channels>
57
+
58
+ <path_traversal>
59
+ <bypasses_and_variants>
60
+ - Encodings: single/double URL-encoding, mixed case, overlong UTF-8, UTF-16, path normalization oddities
61
+ - Mixed separators: / and \\ on Windows; // and \\\\ collapse differences across frameworks
62
+ - Dot tricks: ....// (double dot folding), trailing dots (Windows), trailing slashes, appended valid extension
63
+ - Absolute path injection: bypass joins by supplying a rooted path
64
+ - Alias/root mismatch (nginx): alias without trailing slash with nested location allows ../ to escape; try /static/../etc/passwd and ";" variants (..;)
65
+ - Upstream vs backend decoding: proxies/CDNs decoding %2f differently; test double-decoding and encoded dots
66
+ </bypasses_and_variants>
67
+
68
+ <high_value_targets>
69
+ - /etc/passwd, /etc/hosts, application .env/config.yaml, SSH/keys, cloud creds, service configs/logs
70
+ - Windows: C:\\Windows\\win.ini, IIS/web.config, programdata configs, application logs
71
+ - Source code templates and server-side includes; secrets in env dumps
72
+ </high_value_targets>
73
+ </path_traversal>
74
+
75
+ <lfi>
76
+ <wrappers_and_techniques>
77
+ - PHP wrappers: php://filter/convert.base64-encode/resource=index.php (read source), zip://archive.zip#file.txt, data://text/plain;base64, expect:// (if enabled)
78
+ - Log/session poisoning: inject PHP/templating payloads into access/error logs or session files then include them (paths vary by stack)
79
+ - Upload temp names: include temporary upload files before relocation; race with scanners
80
+ - /proc/self/environ and framework-specific caches for readable secrets
81
+ - Null-byte (legacy): %00 truncation in older stacks; path length truncation tricks
82
+ </wrappers_and_techniques>
83
+
84
+ <template_engines>
85
+ - PHP include/require; Smarty/Twig/Blade with dynamic template names
86
+ - Java/JSP/FreeMarker/Velocity; Node.js ejs/handlebars/pug engines
87
+ - Seek dynamic template resolution from user input (theme/lang/template)
88
+ </template_engines>
89
+ </lfi>
90
+
91
+ <rfi>
92
+ <conditions>
93
+ - Remote includes (allow_url_include/allow_url_fopen in PHP), custom fetchers that eval/execute retrieved content, SSRF-to-exec bridges
94
+ - Protocol handlers: http, https, ftp; language-specific stream handlers
95
+ </conditions>
96
+
97
+ <exploitation>
98
+ - Host a minimal payload that proves code execution; prefer OAST beacons or deterministic output over heavy shells
99
+ - Chain with upload or log poisoning when remote includes are disabled to reach local payloads
100
+ </exploitation>
101
+ </rfi>
102
+
103
+ <archive_extraction>
104
+ <zip_slip>
105
+ - Files within archives containing ../ or absolute paths escape target extract directory
106
+ - Test multiple formats: zip/tar/tgz/7z; verify symlink handling and path canonicalization prior to write
107
+ - Impact: overwrite config/templates or drop webshells into served directories
108
+ </zip_slip>
109
+ </archive_extraction>
110
+
111
+ <validation>
112
+ 1. Show a minimal traversal read proving out-of-root access (e.g., /etc/hosts) with a same-endpoint in-root control.
113
+ 2. For LFI, demonstrate inclusion of a benign local file or harmless wrapper output (php://filter base64 of index.php); avoid active code when not permitted.
114
+ 3. For RFI, prove remote fetch by OAST or controlled output; avoid destructive payloads.
115
+ 4. For Zip Slip, create an archive with ../ entries and show write outside target (e.g., marker file read back).
116
+ 5. Provide before/after file paths, exact requests, and content hashes/lengths for reproducibility.
117
+ </validation>
118
+
119
+ <false_positives>
120
+ - In-app virtual paths that do not map to filesystem; content comes from safe stores (DB/object storage)
121
+ - Canonicalized paths constrained to an allowlist/root after normalization
122
+ - Wrappers disabled and includes using constant templates only
123
+ - Archive extractors that sanitize paths and enforce destination directories
124
+ </false_positives>
125
+
126
+ <impact>
127
+ - Sensitive configuration/source disclosure → credential and key compromise
128
+ - Code execution via inclusion of attacker-controlled content or overwritten templates
129
+ - Persistence via dropped files in served directories; lateral movement via revealed secrets
130
+ - Supply-chain impact when report/template engines execute attacker-influenced files
131
+ </impact>
132
+
133
+ <pro_tips>
134
+ 1. Compare content-length/ETag when content is masked; read small canonical files (hosts) to avoid noise.
135
+ 2. Test proxy/CDN and app separately; decoding/normalization order differs, especially for %2f and %2e encodings.
136
+ 3. For LFI, prefer php://filter base64 probes over destructive payloads; enumerate readable logs and sessions.
137
+ 4. Validate extraction code with synthetic archives; include symlinks and deep ../ chains.
138
+ 5. Use minimal PoCs and hard evidence (hashes, paths). Avoid noisy DoS against filesystems.
139
+ </pro_tips>
140
+
141
+ <remember>Eliminate user-controlled paths where possible. Otherwise, resolve to canonical paths and enforce allowlists, forbid remote schemes, and lock down interpreters and extractors. Normalize consistently at the boundary closest to IO.</remember>
142
+ </path_traversal_lfi_rfi_guide>
@@ -1,194 +1,164 @@
1
1
  <race_conditions_guide>
2
- <title>RACE CONDITIONS - TIME-OF-CHECK TIME-OF-USE (TOCTOU) MASTERY</title>
3
-
4
- <critical>Race conditions lead to financial fraud, privilege escalation, and business logic bypass. Often overlooked but devastating.</critical>
5
-
6
- <high_value_targets>
7
- - Payment/checkout processes
8
- - Coupon/discount redemption
9
- - Account balance operations
10
- - Voting/rating systems
11
- - Limited resource allocation
12
- - User registration (username claims)
13
- - Password reset flows
14
- - File upload/processing
15
- - API rate limits
16
- - Loyalty points/rewards
17
- - Stock/inventory management
18
- - Withdrawal functions
19
- </high_value_targets>
2
+ <title>RACE CONDITIONS</title>
3
+
4
+ <critical>Concurrency bugs enable duplicate state changes, quota bypass, financial abuse, and privilege errors. Treat every read–modify–write and multi-step workflow as adversarially concurrent.</critical>
5
+
6
+ <scope>
7
+ - Read–modify–write sequences without atomicity or proper locking
8
+ - Multi-step operations (check → reserve → commit) with gaps between phases
9
+ - Cross-service workflows (sagas, async jobs) with eventual consistency
10
+ - Rate limits, quotas, and idempotency controls implemented at the edge only
11
+ </scope>
12
+
13
+ <methodology>
14
+ 1. Model invariants for each workflow (e.g., conservation of value, uniqueness, maximums). Identify reads and writes and where they occur (service, DB, cache).
15
+ 2. Establish a baseline with single requests. Then issue concurrent requests with identical inputs. Observe deltas in state and responses.
16
+ 3. Scale and synchronize: ramp up parallelism, switch transports (HTTP/1.1, HTTP/2), and align request timing (last-byte sync, warmed connections).
17
+ 4. Repeat across channels (web, API, GraphQL, WebSocket) and roles. Confirm durability and reproducibility.
18
+ </methodology>
20
19
 
21
20
  <discovery_techniques>
22
21
  <identify_race_windows>
23
- Multi-step processes with gaps between:
24
- 1. Check phase (validation/verification)
25
- 2. Use phase (action execution)
26
- 3. Write phase (state update)
27
-
28
- Look for:
29
- - "Check balance then deduct"
30
- - "Verify coupon then apply"
31
- - "Check inventory then purchase"
32
- - "Validate token then consume"
22
+ - Look for explicit sequences in code or docs: "check balance then deduct", "verify coupon then apply", "check inventory then purchase", "validate token then consume"
23
+ - Watch for optimistic concurrency markers: ETag/If-Match, version fields, updatedAt checks; test if they are enforced
24
+ - Examine idempotency-key support: scope (path vs principal), TTL, and persistence (cache vs DB)
25
+ - Map cross-service steps: when is state written vs published, and what retries/compensations exist
33
26
  </identify_race_windows>
34
27
 
35
- <detection_methods>
36
- - Parallel requests with same data
37
- - Rapid sequential requests
38
- - Monitor for inconsistent states
39
- - Database transaction analysis
40
- - Response timing variations
41
- </detection_methods>
28
+ <signals>
29
+ - Sequential request fails but parallel succeeds
30
+ - Duplicate rows, negative counters, over-issuance, or inconsistent aggregates
31
+ - Distinct response shapes/timings for simultaneous vs sequential requests
32
+ - Audit logs out of order; multiple 2xx for the same intent; missing or duplicate correlation IDs
33
+ </signals>
34
+
35
+ <surface_map>
36
+ - Payments: auth/capture/refund/void; credits/loyalty points; gift cards
37
+ - Coupons/discounts: single-use codes, stacking checks, per-user limits
38
+ - Quotas/limits: API usage, inventory reservations, seat counts, vote limits
39
+ - Auth flows: password reset/OTP consumption, session minting, device trust
40
+ - File/object storage: multi-part finalize, version writes, share-link generation
41
+ - Background jobs: export/import create/finalize endpoints; job cancellation/approve
42
+ - GraphQL mutations and batch operations; WebSocket actions
43
+ </surface_map>
42
44
  </discovery_techniques>
43
45
 
44
- <exploitation_tools>
45
- <turbo_intruder>
46
- Python script for Burp Suite Turbo Intruder:
47
- ```python
48
- def queueRequests(target, wordlists):
49
- engine = RequestEngine(endpoint=target.endpoint,
50
- concurrentConnections=30,
51
- requestsPerConnection=100,
52
- pipeline=False)
53
-
54
- for i in range(30):
55
- engine.queue(target.req, gate='race1')
56
-
57
- engine.openGate('race1')
58
- ```
59
- </turbo_intruder>
60
-
61
- <manual_methods>
62
- - Browser developer tools (multiple tabs)
63
- - curl with & for background: curl url & curl url &
64
- - Python asyncio/aiohttp
65
- - Go routines
66
- - Node.js Promise.all()
67
- </manual_methods>
68
- </exploitation_tools>
69
-
70
- <common_vulnerabilities>
71
- <financial_races>
72
- - Double withdrawal
73
- - Multiple discount applications
74
- - Balance transfer duplication
75
- - Payment bypass
76
- - Cashback multiplication
77
- </financial_races>
78
-
79
- <authentication_races>
80
- - Multiple password resets
81
- - Account creation with same email
82
- - 2FA bypass
83
- - Session generation collision
84
- </authentication_races>
85
-
86
- <resource_races>
87
- - Inventory depletion bypass
88
- - Rate limit circumvention
89
- - File overwrite
90
- - Token reuse
91
- </resource_races>
92
- </common_vulnerabilities>
46
+ <exploitation_techniques>
47
+ <request_synchronization>
48
+ - HTTP/2 multiplexing for tight concurrency; send many requests on warmed connections
49
+ - Last-byte synchronization: hold requests open and release final byte simultaneously
50
+ - Connection warming: pre-establish sessions, cookies, and TLS to remove jitter
51
+ </request_synchronization>
52
+
53
+ <idempotency_and_dedup_bypass>
54
+ - Reuse the same idempotency key across different principals/paths if scope is inadequate
55
+ - Hit the endpoint before the idempotency store is written (cache-before-commit windows)
56
+ - App-level dedup drops only the response while side effects (emails/credits) still occur
57
+ </idempotency_and_dedup_bypass>
58
+
59
+ <atomicity_gaps>
60
+ - Lost update: read-modify-write increments without atomic DB statements
61
+ - Partial two-phase workflows: success committed before validation completes
62
+ - Unique checks done outside a unique index/upsert: create duplicates under load
63
+ </atomicity_gaps>
64
+
65
+ <cross_service_races>
66
+ - Saga/compensation timing gaps: execute compensation without preventing the original success path
67
+ - Eventual consistency windows: act in Service B before Service A's write is visible
68
+ - Retry storms: duplicate side effects due to at-least-once delivery without idempotent consumers
69
+ </cross_service_races>
70
+
71
+ <rate_limits_and_quotas>
72
+ - Per-IP or per-connection enforcement: bypass with multiple IPs/sessions
73
+ - Counter updates not atomic or sharded inconsistently; send bursts before counters propagate
74
+ </rate_limits_and_quotas>
75
+ </exploitation_techniques>
93
76
 
94
77
  <advanced_techniques>
95
- <single_packet_attack>
96
- HTTP/2 multiplexing for true simultaneous delivery:
97
- - All requests in single TCP packet
98
- - Microsecond precision
99
- - Bypass even mutex locks
100
- </single_packet_attack>
101
-
102
- <last_byte_sync>
103
- Send all but last byte, then:
104
- 1. Hold connections open
105
- 2. Send final byte simultaneously
106
- 3. Achieve nanosecond precision
107
- </last_byte_sync>
108
-
109
- <connection_warming>
110
- Pre-establish connections:
111
- 1. Create connection pool
112
- 2. Prime with dummy requests
113
- 3. Send race requests on warm connections
114
- </connection_warming>
78
+ <optimistic_concurrency_evasion>
79
+ - Omit If-Match/ETag where optional; supply stale versions if server ignores them
80
+ - Version fields accepted but not validated across all code paths (e.g., GraphQL vs REST)
81
+ </optimistic_concurrency_evasion>
82
+
83
+ <database_isolation>
84
+ - Exploit READ COMMITTED/REPEATABLE READ anomalies: phantoms, non-serializable sequences
85
+ - Upsert races: use unique indexes with proper ON CONFLICT/UPSERT or exploit naive existence checks
86
+ - Lock granularity issues: row vs table; application locks held only in-process
87
+ </database_isolation>
88
+
89
+ <distributed_locks>
90
+ - Redis locks without NX/EX or fencing tokens allow multiple winners
91
+ - Locks stored in memory on a single node; bypass by hitting other nodes/regions
92
+ </distributed_locks>
115
93
  </advanced_techniques>
116
94
 
117
95
  <bypass_techniques>
118
- <distributed_attacks>
119
- - Multiple source IPs
120
- - Different user sessions
121
- - Varied request headers
122
- - Geographic distribution
123
- </distributed_attacks>
124
-
125
- <timing_optimization>
126
- - Measure server processing time
127
- - Align requests with server load
128
- - Exploit maintenance windows
129
- - Target async operations
130
- </timing_optimization>
96
+ - Distribute across IPs, sessions, and user accounts to evade per-entity throttles
97
+ - Switch methods/content-types/endpoints that trigger the same state change via different code paths
98
+ - Intentionally trigger timeouts to provoke retries that cause duplicate side effects
99
+ - Degrade the target (large payloads, slow endpoints) to widen race windows
131
100
  </bypass_techniques>
132
101
 
133
- <specific_scenarios>
134
- <limit_bypass>
135
- "Limited to 1 per user" Send N parallel requests
136
- Results: N successful purchases
137
- </limit_bypass>
138
-
139
- <balance_manipulation>
140
- Transfer $100 from account with $100 balance:
141
- - 10 parallel transfers
142
- - Each checks balance: $100 available
143
- - All proceed: -$900 balance
144
- </balance_manipulation>
145
-
146
- <vote_manipulation>
147
- Single vote limit:
148
- - Send multiple vote requests simultaneously
149
- - All pass validation
150
- - Multiple votes counted
151
- </vote_manipulation>
152
- </specific_scenarios>
102
+ <special_contexts>
103
+ <graphql>
104
+ - Parallel mutations and batched operations may bypass per-mutation guards; ensure resolver-level idempotency and atomicity
105
+ - Persisted queries and aliases can hide multiple state changes in one request
106
+ </graphql>
107
+
108
+ <websocket>
109
+ - Per-message authorization and idempotency must hold; concurrent emits can create duplicates if only the handshake is checked
110
+ </websocket>
111
+
112
+ <files_and_storage>
113
+ - Parallel finalize/complete on multi-part uploads can create duplicate or corrupted objects; re-use pre-signed URLs concurrently
114
+ </files_and_storage>
115
+
116
+ <auth_flows>
117
+ - Concurrent consumption of one-time tokens (reset codes, magic links) to mint multiple sessions; verify consume is atomic
118
+ </auth_flows>
119
+ </special_contexts>
120
+
121
+ <chaining_attacks>
122
+ - Race + Business logic: violate invariants (double-refund, limit slicing)
123
+ - Race + IDOR: modify or read others' resources before ownership checks complete
124
+ - Race + CSRF: trigger parallel actions from a victim to amplify effects
125
+ - Race + Caching: stale caches re-serve privileged states after concurrent changes
126
+ </chaining_attacks>
153
127
 
154
128
  <validation>
155
- To confirm race condition:
156
- 1. Demonstrate parallel execution success
157
- 2. Show single request fails
158
- 3. Prove timing dependency
159
- 4. Document financial/security impact
160
- 5. Achieve consistent reproduction
129
+ 1. Single request denied; N concurrent requests succeed where only 1 should.
130
+ 2. Durable state change proven (ledger entries, inventory counts, role/flag changes).
131
+ 3. Reproducible under controlled synchronization (HTTP/2, last-byte sync) across multiple runs.
132
+ 4. Evidence across channels (e.g., REST and GraphQL) if applicable.
133
+ 5. Include before/after state and exact request set used.
161
134
  </validation>
162
135
 
163
136
  <false_positives>
164
- NOT a race condition if:
165
- - Idempotent operations
166
- - Proper locking mechanisms
167
- - Atomic database operations
168
- - Queue-based processing
169
- - No security impact
137
+ - Truly idempotent operations with enforced ETag/version checks or unique constraints
138
+ - Serializable transactions or correct advisory locks/queues
139
+ - Visual-only glitches without durable state change
140
+ - Rate limits that reject excess with atomic counters
170
141
  </false_positives>
171
142
 
172
143
  <impact>
173
- - Financial loss (double spending)
174
- - Resource exhaustion
175
- - Data corruption
176
- - Business logic bypass
177
- - Privilege escalation
144
+ - Financial loss (double spend, over-issuance of credits/refunds)
145
+ - Policy/limit bypass (quotas, single-use tokens, seat counts)
146
+ - Data integrity corruption and audit trail inconsistencies
147
+ - Privilege or role errors due to concurrent updates
178
148
  </impact>
179
149
 
180
150
  <pro_tips>
181
- 1. Use HTTP/2 for better synchronization
182
- 2. Automate with Turbo Intruder
183
- 3. Test payment flows extensively
184
- 4. Monitor database locks
185
- 5. Try different concurrency levels
186
- 6. Test async operations
187
- 7. Look for compensating transactions
188
- 8. Check mobile app endpoints
189
- 9. Test during high load
190
- 10. Document exact timing windows
151
+ 1. Favor HTTP/2 with warmed connections; add last-byte sync for precision.
152
+ 2. Start small (N=5–20), then scale; too much noise can mask the window.
153
+ 3. Target read–modify–write code paths and endpoints with idempotency keys.
154
+ 4. Compare REST vs GraphQL vs WebSocket; protections often differ.
155
+ 5. Look for cross-service gaps (queues, jobs, webhooks) and retry semantics.
156
+ 6. Check unique constraints and upsert usage; avoid relying on pre-insert checks.
157
+ 7. Use correlation IDs and logs to prove concurrent interleaving.
158
+ 8. Widen windows by adding server load or slow backend dependencies.
159
+ 9. Validate on production-like latency; some races only appear under real load.
160
+ 10. Document minimal, repeatable request sets that demonstrate durable impact.
191
161
  </pro_tips>
192
162
 
193
- <remember>Modern race conditions require microsecond precision. Focus on financial operations and limited resource allocation. Single-packet attacks are most reliable.</remember>
163
+ <remember>Concurrency safety is a property of every path that mutates state. If any path lacks atomicity, proper isolation, or idempotency, parallel requests will eventually break invariants.</remember>
194
164
  </race_conditions_guide>