strix-agent 0.1.17__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.
- strix/agents/StrixAgent/strix_agent.py +2 -1
- strix/agents/StrixAgent/system_prompt.jinja +8 -10
- strix/agents/base_agent.py +20 -0
- strix/agents/state.py +18 -1
- strix/cli/app.py +92 -15
- strix/cli/main.py +81 -24
- strix/cli/tool_components/base_renderer.py +2 -2
- strix/cli/tool_components/reporting_renderer.py +2 -1
- strix/llm/llm.py +9 -0
- strix/prompts/README.md +64 -0
- strix/prompts/__init__.py +1 -1
- strix/prompts/cloud/.gitkeep +0 -0
- strix/prompts/custom/.gitkeep +0 -0
- strix/prompts/frameworks/fastapi.jinja +142 -0
- strix/prompts/frameworks/nextjs.jinja +126 -0
- strix/prompts/protocols/graphql.jinja +215 -0
- strix/prompts/reconnaissance/.gitkeep +0 -0
- strix/prompts/technologies/firebase_firestore.jinja +177 -0
- strix/prompts/technologies/supabase.jinja +189 -0
- strix/prompts/vulnerabilities/authentication_jwt.jinja +133 -115
- strix/prompts/vulnerabilities/broken_function_level_authorization.jinja +146 -0
- strix/prompts/vulnerabilities/business_logic.jinja +146 -118
- strix/prompts/vulnerabilities/csrf.jinja +137 -131
- strix/prompts/vulnerabilities/idor.jinja +149 -118
- strix/prompts/vulnerabilities/insecure_file_uploads.jinja +188 -0
- strix/prompts/vulnerabilities/mass_assignment.jinja +141 -0
- strix/prompts/vulnerabilities/path_traversal_lfi_rfi.jinja +142 -0
- strix/prompts/vulnerabilities/race_conditions.jinja +135 -165
- strix/prompts/vulnerabilities/rce.jinja +128 -180
- strix/prompts/vulnerabilities/sql_injection.jinja +128 -192
- strix/prompts/vulnerabilities/ssrf.jinja +118 -151
- strix/prompts/vulnerabilities/xss.jinja +144 -196
- strix/prompts/vulnerabilities/xxe.jinja +151 -243
- strix/tools/agents_graph/agents_graph_actions.py +4 -3
- strix/tools/agents_graph/agents_graph_actions_schema.xml +10 -14
- strix/tools/registry.py +1 -1
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/METADATA +55 -16
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/RECORD +41 -28
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/LICENSE +0 -0
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/WHEEL +0 -0
- {strix_agent-0.1.17.dist-info → strix_agent-0.1.19.dist-info}/entry_points.txt +0 -0
|
@@ -1,194 +1,164 @@
|
|
|
1
1
|
<race_conditions_guide>
|
|
2
|
-
<title>RACE CONDITIONS
|
|
3
|
-
|
|
4
|
-
<critical>
|
|
5
|
-
|
|
6
|
-
<
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
<
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
<
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
</
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
<
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
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
|
-
<
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
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
|
|
174
|
-
-
|
|
175
|
-
- Data corruption
|
|
176
|
-
-
|
|
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.
|
|
182
|
-
2.
|
|
183
|
-
3.
|
|
184
|
-
4.
|
|
185
|
-
5.
|
|
186
|
-
6.
|
|
187
|
-
7.
|
|
188
|
-
8.
|
|
189
|
-
9.
|
|
190
|
-
10. Document
|
|
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>
|
|
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>
|