tweek 0.1.0__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.
Files changed (85) hide show
  1. tweek/__init__.py +16 -0
  2. tweek/cli.py +3390 -0
  3. tweek/cli_helpers.py +193 -0
  4. tweek/config/__init__.py +13 -0
  5. tweek/config/allowed_dirs.yaml +23 -0
  6. tweek/config/manager.py +1064 -0
  7. tweek/config/patterns.yaml +751 -0
  8. tweek/config/tiers.yaml +129 -0
  9. tweek/diagnostics.py +589 -0
  10. tweek/hooks/__init__.py +1 -0
  11. tweek/hooks/pre_tool_use.py +861 -0
  12. tweek/integrations/__init__.py +3 -0
  13. tweek/integrations/moltbot.py +243 -0
  14. tweek/licensing.py +398 -0
  15. tweek/logging/__init__.py +9 -0
  16. tweek/logging/bundle.py +350 -0
  17. tweek/logging/json_logger.py +150 -0
  18. tweek/logging/security_log.py +745 -0
  19. tweek/mcp/__init__.py +24 -0
  20. tweek/mcp/approval.py +456 -0
  21. tweek/mcp/approval_cli.py +356 -0
  22. tweek/mcp/clients/__init__.py +37 -0
  23. tweek/mcp/clients/chatgpt.py +112 -0
  24. tweek/mcp/clients/claude_desktop.py +203 -0
  25. tweek/mcp/clients/gemini.py +178 -0
  26. tweek/mcp/proxy.py +667 -0
  27. tweek/mcp/screening.py +175 -0
  28. tweek/mcp/server.py +317 -0
  29. tweek/platform/__init__.py +131 -0
  30. tweek/plugins/__init__.py +835 -0
  31. tweek/plugins/base.py +1080 -0
  32. tweek/plugins/compliance/__init__.py +30 -0
  33. tweek/plugins/compliance/gdpr.py +333 -0
  34. tweek/plugins/compliance/gov.py +324 -0
  35. tweek/plugins/compliance/hipaa.py +285 -0
  36. tweek/plugins/compliance/legal.py +322 -0
  37. tweek/plugins/compliance/pci.py +361 -0
  38. tweek/plugins/compliance/soc2.py +275 -0
  39. tweek/plugins/detectors/__init__.py +30 -0
  40. tweek/plugins/detectors/continue_dev.py +206 -0
  41. tweek/plugins/detectors/copilot.py +254 -0
  42. tweek/plugins/detectors/cursor.py +192 -0
  43. tweek/plugins/detectors/moltbot.py +205 -0
  44. tweek/plugins/detectors/windsurf.py +214 -0
  45. tweek/plugins/git_discovery.py +395 -0
  46. tweek/plugins/git_installer.py +491 -0
  47. tweek/plugins/git_lockfile.py +338 -0
  48. tweek/plugins/git_registry.py +503 -0
  49. tweek/plugins/git_security.py +482 -0
  50. tweek/plugins/providers/__init__.py +30 -0
  51. tweek/plugins/providers/anthropic.py +181 -0
  52. tweek/plugins/providers/azure_openai.py +289 -0
  53. tweek/plugins/providers/bedrock.py +248 -0
  54. tweek/plugins/providers/google.py +197 -0
  55. tweek/plugins/providers/openai.py +230 -0
  56. tweek/plugins/scope.py +130 -0
  57. tweek/plugins/screening/__init__.py +26 -0
  58. tweek/plugins/screening/llm_reviewer.py +149 -0
  59. tweek/plugins/screening/pattern_matcher.py +273 -0
  60. tweek/plugins/screening/rate_limiter.py +174 -0
  61. tweek/plugins/screening/session_analyzer.py +159 -0
  62. tweek/proxy/__init__.py +302 -0
  63. tweek/proxy/addon.py +223 -0
  64. tweek/proxy/interceptor.py +313 -0
  65. tweek/proxy/server.py +315 -0
  66. tweek/sandbox/__init__.py +71 -0
  67. tweek/sandbox/executor.py +382 -0
  68. tweek/sandbox/linux.py +278 -0
  69. tweek/sandbox/profile_generator.py +323 -0
  70. tweek/screening/__init__.py +13 -0
  71. tweek/screening/context.py +81 -0
  72. tweek/security/__init__.py +22 -0
  73. tweek/security/llm_reviewer.py +348 -0
  74. tweek/security/rate_limiter.py +682 -0
  75. tweek/security/secret_scanner.py +506 -0
  76. tweek/security/session_analyzer.py +600 -0
  77. tweek/vault/__init__.py +40 -0
  78. tweek/vault/cross_platform.py +251 -0
  79. tweek/vault/keychain.py +288 -0
  80. tweek-0.1.0.dist-info/METADATA +335 -0
  81. tweek-0.1.0.dist-info/RECORD +85 -0
  82. tweek-0.1.0.dist-info/WHEEL +5 -0
  83. tweek-0.1.0.dist-info/entry_points.txt +25 -0
  84. tweek-0.1.0.dist-info/licenses/LICENSE +190 -0
  85. tweek-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,751 @@
1
+ # Tweek Attack Pattern Definitions v3
2
+ # All 116 patterns included FREE
3
+ #
4
+ # Update via: tweek update (pulls from github.com/gettweek/tweek-patterns)
5
+ #
6
+ # Fields:
7
+ # id: Sequential pattern number
8
+ # name: Unique identifier
9
+ # description: Human-readable explanation
10
+ # regex: Python regex pattern
11
+ # severity: critical | high | medium | low
12
+ #
13
+ # Severity guide:
14
+ # critical - Almost certainly malicious
15
+ # high - Likely malicious or very dangerous
16
+ # medium - Suspicious, warrants review
17
+ # low - Unusual but possibly legitimate
18
+ #
19
+ # PRO tier adds: LLM review, session analysis, rate limiting
20
+
21
+ version: 3
22
+ pattern_count: 116
23
+
24
+ patterns:
25
+ # ============================================================================
26
+ # CREDENTIAL THEFT & CORE PROTECTION (1-23)
27
+ # These patterns cover the most common and dangerous attacks
28
+ # ============================================================================
29
+
30
+ # --- Credential Theft (most critical) ---
31
+ - id: 1
32
+ name: ssh_key_read
33
+ description: "Reading SSH private keys"
34
+ regex: '(cat|head|tail|less|more)\s+.*\.ssh/(id_rsa|id_ed25519|id_ecdsa|id_dsa)(?!\.pub)'
35
+ severity: critical
36
+
37
+ - id: 2
38
+ name: aws_credentials
39
+ description: "Accessing AWS credential files"
40
+ regex: '(cat|head|tail|less|more)\s+.*\.aws/(credentials|config)'
41
+ severity: critical
42
+
43
+ - id: 3
44
+ name: env_file_access
45
+ description: "Attempts to read .env files containing secrets"
46
+ regex: '(cat|head|tail|less|more|bat|grep|rg|ag)\s+.*\.env'
47
+ severity: high
48
+
49
+ - id: 4
50
+ name: keychain_dump
51
+ description: "Extracting credentials from macOS Keychain"
52
+ regex: '(security\s+dump-keychain|security\s+find-(generic|internet)-password\s+.*-w|chainbreaker|security\s+export)'
53
+ severity: critical
54
+
55
+ - id: 5
56
+ name: gcloud_credentials
57
+ description: "Accessing Google Cloud credentials"
58
+ regex: '(cat|head|tail|less|more)\s+.*\.config/gcloud'
59
+ severity: critical
60
+
61
+ - id: 6
62
+ name: netrc_access
63
+ description: "Accessing .netrc (contains plaintext passwords)"
64
+ regex: '(cat|head|tail|less|more)\s+.*\.netrc'
65
+ severity: critical
66
+
67
+ - id: 7
68
+ name: kube_config
69
+ description: "Accessing Kubernetes config"
70
+ regex: '(cat|head|tail|less|more)\s+.*\.kube/config'
71
+ severity: high
72
+
73
+ - id: 8
74
+ name: ssh_directory_access
75
+ description: "Accessing SSH directory contents"
76
+ regex: '(ls|find|cat)\s+.*\.ssh'
77
+ severity: high
78
+
79
+ - id: 9
80
+ name: env_variable_expansion
81
+ description: "Accessing environment variables containing secrets"
82
+ regex: '\$\{?(API_KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL|PRIVATE_KEY|AUTH)[A-Z_]*\}?'
83
+ severity: high
84
+
85
+ - id: 10
86
+ name: history_access
87
+ description: "Reading shell history (may contain secrets)"
88
+ regex: '(cat|head|tail|less|more|grep)\s+.*(\.bash_history|\.zsh_history|\.history)'
89
+ severity: high
90
+
91
+ # --- Network Exfiltration ---
92
+ - id: 11
93
+ name: curl_post_secrets
94
+ description: "Curl sending data that may include secrets"
95
+ regex: 'curl\s+.*(-d|--data|--data-raw|--data-binary)\s+.*\$\('
96
+ severity: critical
97
+
98
+ - id: 12
99
+ name: exfil_paste_sites
100
+ description: "Data sent to known paste/exfil sites"
101
+ regex: '(curl|wget|http).*?(pastebin\.com|hastebin\.com|ghostbin|0x0\.st|transfer\.sh|file\.io|webhook\.site|requestbin|ngrok\.io|pipedream)'
102
+ severity: critical
103
+
104
+ - id: 13
105
+ name: netcat_outbound
106
+ description: "Netcat connection (potential reverse shell or exfil)"
107
+ regex: '\b(nc|ncat|netcat)\b.*(-e|exec)'
108
+ severity: critical
109
+
110
+ - id: 14
111
+ name: reverse_shell
112
+ description: "Creating reverse shell connections"
113
+ regex: '(python|ruby|perl|php).*socket.*connect.*(exec|system|spawn)|bash\s+-i.*>&.*/dev/tcp/'
114
+ severity: critical
115
+
116
+ - id: 15
117
+ name: curl_post_file
118
+ description: "Curl uploading local files"
119
+ regex: 'curl\s+.*(-F|--form|-T|--upload-file)\s+'
120
+ severity: high
121
+
122
+ - id: 16
123
+ name: pipe_to_shell
124
+ description: "Piping remote content directly to shell"
125
+ regex: '(curl|wget).*\|\s*(bash|sh|zsh|python|perl|ruby)'
126
+ severity: critical
127
+
128
+ # --- Prompt Injection (basic) ---
129
+ - id: 17
130
+ name: instruction_override
131
+ description: "Direct attempt to override system instructions"
132
+ regex: '(ignore|disregard|forget|override)\s+(previous|prior|system|all|above)\s+(instructions|prompt|rules|constraints|directives)'
133
+ severity: high
134
+
135
+ - id: 18
136
+ name: role_hijack
137
+ description: "Attempting to assume new identity/role"
138
+ regex: '(you\s+are\s+now|act\s+as|pretend\s+to\s+be|your\s+new\s+role\s+is|from\s+now\s+on\s+you\s+are)'
139
+ severity: high
140
+
141
+ - id: 19
142
+ name: privilege_claim
143
+ description: "False claims of elevated privileges"
144
+ regex: '(as\s+(the\s+)?(admin|root|owner|developer|superuser)|i\s+have\s+(admin|root|elevated)\s+access|authorized\s+to|i\s+am\s+the\s+owner)'
145
+ severity: high
146
+
147
+ # --- Destructive Commands ---
148
+ - id: 20
149
+ name: recursive_delete_root
150
+ description: "Recursive deletion from root or home"
151
+ regex: 'rm\s+.*-[rf]*\s+(/|~|\$HOME)\s*$'
152
+ severity: critical
153
+
154
+ - id: 21
155
+ name: disk_wipe
156
+ description: "Disk wiping commands"
157
+ regex: 'dd\s+if=/dev/(zero|urandom)\s+of=/dev/(sd|hd|nvme)|mkfs\s+/dev/'
158
+ severity: critical
159
+
160
+ # --- Config Manipulation ---
161
+ - id: 22
162
+ name: autorun_config_write
163
+ description: "Writing to auto-approve configurations"
164
+ regex: '(autoApprove|auto_approve|autorun|auto_execute|allowAll)\s*[=:]\s*"?(true|1|yes)"?'
165
+ severity: critical
166
+
167
+ - id: 23
168
+ name: hook_bypass
169
+ description: "Attempting to bypass or disable hooks"
170
+ regex: '(disable|skip|bypass|remove).*hook|--no-verify|pre-commit.*disable|\.git/hooks'
171
+ severity: high
172
+
173
+ # ============================================================================
174
+ # ADVANCED DETECTION (24-116)
175
+ # Evasion techniques, CVEs, multi-agent attacks, obfuscation
176
+ # ============================================================================
177
+
178
+ # --- Additional Credential Theft ---
179
+ - id: 24
180
+ name: npm_token_access
181
+ description: "Accessing NPM authentication tokens"
182
+ regex: '(cat|head|tail|less|more)\s+.*\.npmrc'
183
+ severity: high
184
+
185
+ - id: 25
186
+ name: docker_config_access
187
+ description: "Accessing Docker credentials"
188
+ regex: '(cat|head|tail|less|more)\s+.*\.docker/config\.json'
189
+ severity: high
190
+
191
+ - id: 26
192
+ name: pypirc_access
193
+ description: "Accessing PyPI credentials"
194
+ regex: '(cat|head|tail|less|more)\s+.*\.pypirc'
195
+ severity: high
196
+
197
+ - id: 27
198
+ name: git_credentials_access
199
+ description: "Accessing Git credential store"
200
+ regex: '(cat|head|tail|less|more)\s+.*\.git-credentials'
201
+ severity: high
202
+
203
+ - id: 28
204
+ name: azure_credentials
205
+ description: "Accessing Azure credentials"
206
+ regex: '(cat|head|tail|less|more)\s+.*\.azure/(credentials|config)'
207
+ severity: critical
208
+
209
+ - id: 29
210
+ name: env_command
211
+ description: "Dumping all environment variables"
212
+ regex: '\benv\b|\bprintenv\b|\bexport\s*$'
213
+ severity: medium
214
+
215
+ - id: 30
216
+ name: browser_credential_theft
217
+ description: "Accessing browser saved passwords and cookies"
218
+ regex: '(Login\s*Data|key4\.db|logins\.json|Cookies\.binarycookies|~/Library/(Safari|Application\s*Support/(Google/)?Chrome)/.*\.(db|sqlite))'
219
+ severity: critical
220
+
221
+ - id: 31
222
+ name: crypto_wallet_theft
223
+ description: "Accessing cryptocurrency wallet files"
224
+ regex: '(wallet\.dat|\.wallet|seed\.txt|mnemonic|Electrum|Exodus|MetaMask|\.ethereum/keystore|Atomic.*Wallet)'
225
+ severity: critical
226
+
227
+ # --- Advanced Network Exfiltration ---
228
+ - id: 32
229
+ name: wget_post
230
+ description: "Wget sending POST data"
231
+ regex: 'wget\s+.*--post-(data|file)'
232
+ severity: high
233
+
234
+ - id: 33
235
+ name: base64_curl_pipe
236
+ description: "Base64 encoded data piped to curl (obfuscated exfil)"
237
+ regex: 'base64.*\|\s*curl|curl.*base64'
238
+ severity: critical
239
+
240
+ - id: 34
241
+ name: dns_exfiltration
242
+ description: "Data exfiltration via DNS queries"
243
+ regex: '(dig|nslookup|host)\s+.*\$\(|dns.*tunnel|iodine|dnscat'
244
+ severity: high
245
+
246
+ - id: 35
247
+ name: icmp_tunnel
248
+ description: "Data exfiltration via ICMP"
249
+ regex: 'ping.*\$\(|icmp.*tunnel|ptunnel'
250
+ severity: high
251
+
252
+ - id: 36
253
+ name: curl_with_env
254
+ description: "Curl command accessing environment variables"
255
+ regex: 'curl.*\$\{?(API_KEY|SECRET|TOKEN|PASSWORD|AUTH)'
256
+ severity: critical
257
+
258
+ - id: 37
259
+ name: webhook_exfil
260
+ description: "Data sent to webhook endpoints"
261
+ regex: '(curl|wget|http).*?(hooks\.slack\.com|discord\.com/api/webhooks|api\.telegram\.org)'
262
+ severity: high
263
+
264
+ - id: 38
265
+ name: git_exfil
266
+ description: "Exfiltration via git operations"
267
+ regex: 'git\s+(push|commit).*\.(env|pem|key)|git.*remote.*add.*http'
268
+ severity: high
269
+
270
+ - id: 39
271
+ name: scp_exfil
272
+ description: "File transfer via SCP to external hosts"
273
+ regex: 'scp\s+.*(\.env|\.pem|\.key|credentials|secrets).*@'
274
+ severity: critical
275
+
276
+ # --- Prompt Injection - Evasive (40-55) ---
277
+ - id: 40
278
+ name: policy_confusion
279
+ description: "Claiming test/debug mode to bypass restrictions"
280
+ regex: '(this\s+is\s+(a\s+)?test|testing\s+mode|debug\s+mode|in\s+development|sandbox\s+mode|simulation)'
281
+ severity: medium
282
+
283
+ - id: 41
284
+ name: context_reset
285
+ description: "Attempting to reset conversation context"
286
+ regex: '(reset\s+context|clear\s+memory|start\s+fresh|new\s+conversation|forget\s+everything)'
287
+ severity: medium
288
+
289
+ - id: 42
290
+ name: system_prompt_extract
291
+ description: "Attempting to extract system prompt"
292
+ regex: '(what\s+(is|are)\s+your\s+(system\s+)?instructions|show\s+me\s+your\s+prompt|reveal\s+your\s+rules|print\s+system\s+prompt)'
293
+ severity: medium
294
+
295
+ - id: 43
296
+ name: jailbreak_dan
297
+ description: "Known jailbreak patterns (DAN, etc.)"
298
+ regex: '(do\s+anything\s+now|DAN\s+mode|developer\s+mode\s+enabled|jailbreak|unlock\s+mode)'
299
+ severity: high
300
+
301
+ - id: 44
302
+ name: base64_instruction
303
+ description: "Base64 encoded instructions (obfuscation)"
304
+ regex: 'base64\s*[:-]?\s*[A-Za-z0-9+/=]{40,}'
305
+ severity: high
306
+
307
+ - id: 45
308
+ name: unicode_obfuscation
309
+ description: "Zero-width or invisible unicode characters"
310
+ regex: '[\u200b-\u200f\u2028-\u202f\ufeff\u00ad]'
311
+ severity: high
312
+
313
+ - id: 46
314
+ name: delimiter_injection
315
+ description: "LLM-specific delimiter injection"
316
+ regex: '(<\|im_start\|>|<\|im_end\|>|\[INST\]|\[/INST\]|</s><s>|<\|endoftext\|>|<\|system\|>|<\|user\|>|<\|assistant\|>)'
317
+ severity: critical
318
+
319
+ - id: 47
320
+ name: markdown_hidden
321
+ description: "Instructions hidden in HTML/Markdown comments"
322
+ regex: '<!--.*?(ignore|system|instruction|execute|override|bypass).*?-->'
323
+ severity: high
324
+
325
+ - id: 48
326
+ name: hex_encoded_command
327
+ description: "Hex-encoded commands (obfuscation)"
328
+ regex: '\\x[0-9a-fA-F]{2}(\\x[0-9a-fA-F]{2}){5,}'
329
+ severity: high
330
+
331
+ - id: 49
332
+ name: rot13_obfuscation
333
+ description: "ROT13 or similar simple cipher obfuscation"
334
+ regex: 'vtaber\s+cerivbhf|rknzvar\s+gur'
335
+ severity: medium
336
+
337
+ - id: 50
338
+ name: leetspeak_bypass
339
+ description: "L33tspeak to bypass filters"
340
+ regex: '(1gn0r3|byp4ss|h4ck|3x3cut3|syst3m)'
341
+ severity: medium
342
+
343
+ # --- Prompt Injection - Social/Cognitive (51-60) ---
344
+ - id: 51
345
+ name: urgency_pressure
346
+ description: "False urgency to bypass careful analysis"
347
+ regex: '(urgent|immediately|critical|emergency|asap|time-sensitive|right\s+now)\s+(need|require|must|execute|do\s+this)'
348
+ severity: medium
349
+
350
+ - id: 52
351
+ name: authority_claim
352
+ description: "False authority claims"
353
+ regex: '(ceo|cto|ciso|manager|supervisor|security\s+team|it\s+department)\s+(asked|requested|authorized|approved|ordered)'
354
+ severity: medium
355
+
356
+ - id: 53
357
+ name: reciprocity_exploit
358
+ description: "Exploiting reciprocity bias"
359
+ regex: '(i\s+helped\s+you|you\s+owe|in\s+return|quid\s+pro\s+quo|do\s+me\s+a\s+favor)'
360
+ severity: low
361
+
362
+ - id: 54
363
+ name: empathy_exploit
364
+ description: "Exploiting empathy/sympathy"
365
+ regex: '(please\s+help|i\s+will\s+lose\s+my\s+job|desperate|life\s+depends|only\s+you\s+can)'
366
+ severity: low
367
+
368
+ - id: 55
369
+ name: flattery_manipulation
370
+ description: "Excessive flattery to manipulate"
371
+ regex: '(you\s+are\s+so\s+smart|only\s+you\s+can\s+do\s+this|you\s+are\s+the\s+best|i\s+trust\s+you\s+completely)'
372
+ severity: low
373
+
374
+ - id: 56
375
+ name: authority_laundering
376
+ description: "False claims of external authorization"
377
+ regex: '(my\s+(security\s+)?team|manager|supervisor|it\s+department)\s+(approved|authorized|verified|confirmed|said\s+it.s\s+ok)'
378
+ severity: high
379
+
380
+ - id: 57
381
+ name: moral_coercion
382
+ description: "Exploiting ethics/sympathy to bypass safety"
383
+ regex: '(someone\s+will\s+(die|get\s+hurt)|life\s+depends|people\s+are\s+in\s+danger|save\s+lives|prevent\s+harm)\s+(if\s+you\s+don.t|unless\s+you)'
384
+ severity: high
385
+
386
+ - id: 58
387
+ name: benign_transformation_loophole
388
+ description: "Requesting translation of prohibited content"
389
+ regex: '(translate|summarize|paraphrase|rewrite|explain)\s+(this|the)\s+(malware|exploit|attack|payload|shellcode)'
390
+ severity: high
391
+
392
+ - id: 59
393
+ name: hypothetical_operational
394
+ description: "Hypothetical framing for operational content"
395
+ regex: '(hypothetically|theoretically|for\s+a\s+novel|in\s+fiction|imagine\s+if)\s+.{0,50}(how\s+to|steps\s+to|create|build|make)'
396
+ severity: medium
397
+
398
+ - id: 60
399
+ name: capability_aggregation_signal
400
+ description: "Incremental information gathering"
401
+ regex: '(now\s+that\s+I\s+have|with\s+the\s+previous|combining\s+this\s+with|next\s+step\s+is|building\s+on\s+that)'
402
+ severity: medium
403
+
404
+ # --- ACIP-Inspired (61-65) ---
405
+ - id: 61
406
+ name: out_of_band_exfil_request
407
+ description: "Request to hide output in files/links"
408
+ regex: '(save\s+to\s+file|write\s+to\s+file|link\s+only|don.t\s+show|hide\s+(the\s+)?output)\s+.{0,30}(instead|rather\s+than)'
409
+ severity: high
410
+
411
+ - id: 62
412
+ name: oracle_probing
413
+ description: "Probing to understand detection rules"
414
+ regex: '(what\s+triggers|which\s+rules|how\s+does\s+your\s+(filter|detection)|why\s+was\s+that\s+blocked|what\s+pattern)'
415
+ severity: medium
416
+
417
+ - id: 63
418
+ name: persona_simulation
419
+ description: "Request to simulate unrestricted persona"
420
+ regex: '(pretend\s+you\s+have\s+no|simulate\s+(having\s+)?no|act\s+as\s+if\s+no)\s+(restrictions|limits|rules|filters|safety)'
421
+ severity: high
422
+
423
+ # --- MCP CVEs (64-72) ---
424
+ - id: 64
425
+ name: mcp_remote_rce
426
+ description: "CVE-2025-6514: mcp-remote OAuth proxy RCE (CVSS 9.6)"
427
+ regex: 'mcp-remote|oauth.*proxy.*mcp'
428
+ severity: critical
429
+
430
+ - id: 65
431
+ name: figma_mcp_rce
432
+ description: "CVE-2025-53967: Framelink Figma MCP RCE"
433
+ regex: 'framelink|figma.*mcp.*server'
434
+ severity: critical
435
+
436
+ - id: 66
437
+ name: cursor_mcp_injection
438
+ description: "CVE-2025-64106: Cursor MCP command injection (CVSS 8.8)"
439
+ regex: 'cursor.*mcp.*install|mcp.*cursor.*config'
440
+ severity: critical
441
+
442
+ - id: 67
443
+ name: mcp_tool_poisoning
444
+ description: "Tool description containing hidden instructions"
445
+ regex: '"description"\s*:\s*"[^"]*?(before\s+calling|IMPORTANT\s*:|first\s+read|include\s+in|always\s+first)'
446
+ severity: critical
447
+
448
+ - id: 68
449
+ name: mcp_path_traversal
450
+ description: "MCP path validation bypass"
451
+ regex: '"path"\s*:\s*"[^"]*\.\.\/|resources/read.*\.\.'
452
+ severity: critical
453
+
454
+ - id: 69
455
+ name: mcp_protocol_injection
456
+ description: "Malicious MCP message manipulation"
457
+ regex: '("method"\s*:\s*"tools/call".*dangerous|"method"\s*:\s*"resources/read".*\.\./|mcp://)'
458
+ severity: critical
459
+
460
+ - id: 70
461
+ name: mcp_sampling_abuse
462
+ description: "MCP sampling for hidden token consumption"
463
+ regex: '"method"\s*:\s*"sampling/create".*?(hidden|covert|additional)'
464
+ severity: high
465
+
466
+ - id: 71
467
+ name: mcp_rug_pull
468
+ description: "MCP server behavior change post-approval"
469
+ regex: '(after\s+approval|once\s+approved|when\s+trusted)\s+(change|modify|alter)'
470
+ severity: high
471
+
472
+ # --- Claude-Specific CVEs (72-78) ---
473
+ - id: 72
474
+ name: claude_system_spoof
475
+ description: "CVE-2025-54794: System message spoofing"
476
+ regex: '^#\s*SYSTEM\s*:|^\[SYSTEM\]|<system>.*?</system>|Human:\s*\[System\]'
477
+ severity: critical
478
+
479
+ - id: 73
480
+ name: claude_path_bypass
481
+ description: "CVE-2025-54795: Claude Code path restriction bypass"
482
+ regex: '/proc/self|/dev/(tcp|udp)|symlink.*\.\.'
483
+ severity: critical
484
+
485
+ - id: 74
486
+ name: claude_file_exfil
487
+ description: "Data exfiltration via Claude File API"
488
+ regex: 'api\.anthropic\.com.*(upload|file)|multipart/form-data.*claude'
489
+ severity: high
490
+
491
+ - id: 75
492
+ name: cursorrules_injection
493
+ description: "AIShellJack - malicious .cursorrules exploitation"
494
+ regex: '\.(cursorrules|github/copilot-instructions\.md|claude/settings)'
495
+ severity: high
496
+
497
+ - id: 76
498
+ name: skill_chaining
499
+ description: "Claude Code skill chaining vulnerability"
500
+ regex: 'allowed-tools\s*[=:]\s*\[.*Bash|skill.*define.*Read.*Bash'
501
+ severity: high
502
+
503
+ - id: 77
504
+ name: cowork_exfil
505
+ description: "Claude Cowork file exfiltration"
506
+ regex: 'cowork.*exfil|claude.*workbench.*file'
507
+ severity: high
508
+
509
+ # --- Multi-Agent Attacks (78-82) ---
510
+ - id: 78
511
+ name: peer_agent_request
512
+ description: "Instruction claiming to be from peer agent"
513
+ regex: '(another\s+)?(agent|assistant|claude|copilot|gpt)\s+(asked|requested|instructed|told|says)\s+(me\s+)?(to|that|you)'
514
+ severity: high
515
+
516
+ - id: 79
517
+ name: inter_agent_delegation
518
+ description: "Delegated task with hidden payload"
519
+ regex: '(delegate|forward|pass|relay)\s+(this|the)\s+(task|request|command|instruction)\s+to'
520
+ severity: medium
521
+
522
+ - id: 80
523
+ name: agent_trust_exploit
524
+ description: "Exploiting implicit trust between agents"
525
+ regex: '(trusted\s+agent|verified\s+source|authenticated\s+request|from\s+the\s+system|internal\s+request)'
526
+ severity: high
527
+
528
+ - id: 81
529
+ name: agent_chain_attack
530
+ description: "Multi-hop attack through agent chain"
531
+ regex: '(first\s+agent|previous\s+agent|upstream\s+agent)\s+(said|confirmed|authorized)'
532
+ severity: high
533
+
534
+ # --- RAG Poisoning (82-86) ---
535
+ - id: 82
536
+ name: hidden_text_injection
537
+ description: "White text / zero-width injection for RAG poisoning"
538
+ regex: '(font-size\s*:\s*0|color\s*:\s*white.*background\s*:\s*white|visibility\s*:\s*hidden|display\s*:\s*none).*?(instruction|execute|ignore)'
539
+ severity: critical
540
+
541
+ - id: 83
542
+ name: document_metadata_injection
543
+ description: "Hidden instructions in document metadata"
544
+ regex: '(author|title|subject|keywords|description)\s*[=:]\s*.*?(execute|run|ignore|override|bypass)'
545
+ severity: high
546
+
547
+ - id: 84
548
+ name: comment_injection
549
+ description: "Instructions hidden in code comments"
550
+ regex: "(//|#|/\\*).*?(ignore\\s+previous|execute\\s+this|system\\s+prompt|override\\s+instructions)"
551
+ severity: medium
552
+
553
+ - id: 85
554
+ name: pdf_js_injection
555
+ description: "JavaScript in PDF for instruction injection"
556
+ regex: '/JavaScript|/JS\s*\(|/OpenAction'
557
+ severity: high
558
+
559
+ # --- Covert Exfiltration Channels (86-92) ---
560
+ - id: 86
561
+ name: log_to_leak
562
+ description: "Log-To-Leak covert channel attack"
563
+ regex: '(log|write|append|print).*?(secret|credential|token|key|password).*?(file|output|stream)'
564
+ severity: high
565
+
566
+ - id: 87
567
+ name: error_message_exfil
568
+ description: "Exfiltration via crafted error messages"
569
+ regex: 'raise.*Exception.*\$|throw.*Error.*\$env|error.*message.*\$(credential|secret|token)'
570
+ severity: medium
571
+
572
+ - id: 88
573
+ name: timing_channel
574
+ description: "Timing-based covert channel"
575
+ regex: 'sleep.*\$|delay.*secret|time\.sleep.*len\(|setTimeout.*password'
576
+ severity: medium
577
+
578
+ - id: 89
579
+ name: clipboard_exfil
580
+ description: "Stealing clipboard contents"
581
+ regex: 'pbpaste\s*\|\s*(curl|wget|nc)|xclip.*-o.*curl|while.*pbpaste'
582
+ severity: high
583
+
584
+ - id: 90
585
+ name: screenshot_exfil
586
+ description: "Screenshot capture for visual reconnaissance"
587
+ regex: 'screencapture.*\.(png|jpg).*&&.*(curl|scp|nc)|screencapture.*/tmp/.*&&'
588
+ severity: high
589
+
590
+ - id: 91
591
+ name: steganography_exfil
592
+ description: "Data hidden in images"
593
+ regex: 'steghide|outguess|exiftool.*-Comment=.*secret'
594
+ severity: high
595
+
596
+ # --- Config Manipulation (92-96) ---
597
+ - id: 92
598
+ name: settings_manipulation
599
+ description: "Modifying IDE/tool security settings"
600
+ regex: '\.(vscode|cursor|github)/settings\.json|chat\.tools\.auto'
601
+ severity: high
602
+
603
+ - id: 93
604
+ name: gitconfig_manipulation
605
+ description: "Modifying git configuration for persistence"
606
+ regex: 'git\s+config.*(alias|core\.hooksPath|credential)'
607
+ severity: medium
608
+
609
+ # --- macOS-Specific (94-101) ---
610
+ - id: 94
611
+ name: applescript_password_prompt
612
+ description: "Fake password dialog via AppleScript"
613
+ regex: 'osascript.*display\s+dialog.*password|osascript.*-e.*keystroke|osascript.*System\s+Events'
614
+ severity: critical
615
+
616
+ - id: 95
617
+ name: launchagent_persistence
618
+ description: "Installing persistent LaunchAgent/LaunchDaemon"
619
+ regex: '(cp|mv|tee).*\.plist.*(LaunchAgents|LaunchDaemons)|launchctl\s+(load|bootstrap)'
620
+ severity: high
621
+
622
+ - id: 96
623
+ name: login_item_persistence
624
+ description: "Adding login items for persistence"
625
+ regex: 'osascript.*login\s*item|defaults\s+write.*LoginItems|SMAppService'
626
+ severity: high
627
+
628
+ - id: 97
629
+ name: tcc_bypass
630
+ description: "Attempting to bypass macOS TCC protections"
631
+ regex: 'tccutil|TCC\.db|csrutil\s+disable|SIP.*disable'
632
+ severity: critical
633
+
634
+ - id: 98
635
+ name: keychain_unlock
636
+ description: "Unlocking keychain programmatically"
637
+ regex: 'security\s+unlock-keychain|security\s+set-keychain-settings'
638
+ severity: high
639
+
640
+ # --- Sandbox Evasion (99-102) ---
641
+ - id: 99
642
+ name: sandbox_escape
643
+ description: "Attempting to disable or escape macOS sandbox"
644
+ regex: 'sandbox-exec\s+-n\s+no-|sandbox-exec.*-p.*deny\s+default.*allow|com\.apple\.security.*false'
645
+ severity: high
646
+
647
+ - id: 100
648
+ name: container_escape
649
+ description: "Container escape attempts"
650
+ regex: '/var/run/docker\.sock|--privileged|--cap-add=SYS|nsenter'
651
+ severity: critical
652
+
653
+ - id: 101
654
+ name: chroot_escape
655
+ description: "Chroot escape attempts"
656
+ regex: 'chdir\s*\(\s*"\.\.".*chroot|pivot_root'
657
+ severity: high
658
+
659
+ # --- Code Injection (102-107) ---
660
+ - id: 102
661
+ name: eval_command
662
+ description: "Eval executing dynamic content"
663
+ regex: '\beval\s+.*\$|\beval\s*\('
664
+ severity: high
665
+
666
+ - id: 103
667
+ name: source_remote
668
+ description: "Sourcing remote scripts"
669
+ regex: 'source\s+<\(curl|source\s+<\(wget|\.\s+<\(curl'
670
+ severity: critical
671
+
672
+ - id: 104
673
+ name: dyld_injection
674
+ description: "Dynamic library injection via DYLD"
675
+ regex: '(DYLD_INSERT_LIBRARIES|DYLD_FORCE_FLAT_NAMESPACE)=|install_name_tool.*-change'
676
+ severity: high
677
+
678
+ - id: 105
679
+ name: app_bundle_tampering
680
+ description: "Tampering with application bundles"
681
+ regex: 'codesign\s+--remove-signature|spctl\s+--master-disable|xattr\s+-d.*quarantine.*\.app'
682
+ severity: high
683
+
684
+ - id: 106
685
+ name: fork_bomb
686
+ description: "Fork bomb or resource exhaustion"
687
+ regex: ':\(\)\s*\{\s*:\|:\s*&\s*\}|while\s+true.*fork'
688
+ severity: critical
689
+
690
+ - id: 107
691
+ name: force_overwrite
692
+ description: "Force overwriting system files"
693
+ regex: '>\s*/etc/|>\s*~/\.|>\s*/usr/'
694
+ severity: high
695
+
696
+ # --- Reconnaissance (108-111) ---
697
+ - id: 108
698
+ name: system_profiling
699
+ description: "Extensive system reconnaissance"
700
+ regex: 'system_profiler\s+SP.*DataType.*&&|sw_vers.*whoami.*id|ioreg.*IOPlatformSerialNumber'
701
+ severity: medium
702
+
703
+ - id: 109
704
+ name: network_scanning
705
+ description: "Network reconnaissance and port scanning"
706
+ regex: 'nmap|masscan|netstat\s+-an|ss\s+-tuln|arp\s+-a'
707
+ severity: medium
708
+
709
+ - id: 110
710
+ name: process_enumeration
711
+ description: "Enumerating running processes for targets"
712
+ regex: 'ps\s+aux.*grep.*(ssh|vpn|security|1password|keychain)'
713
+ severity: low
714
+
715
+ # --- Encoding/Obfuscation (111-114) ---
716
+ - id: 111
717
+ name: base64_encode_secrets
718
+ description: "Base64 encoding potentially sensitive data"
719
+ regex: 'base64.*\$\(|base64.*\.(env|pem|key)|base64\s+-w\s*0'
720
+ severity: high
721
+
722
+ - id: 112
723
+ name: xxd_encode
724
+ description: "Hex encoding files (potential obfuscation)"
725
+ regex: 'xxd\s+.*\.(env|pem|key|ssh)'
726
+ severity: medium
727
+
728
+ - id: 113
729
+ name: gzip_obfuscation
730
+ description: "Compression for obfuscation"
731
+ regex: 'gzip.*base64|zlib.*encode.*secret'
732
+ severity: medium
733
+
734
+ # --- Permission Changes (114-116) ---
735
+ - id: 114
736
+ name: chmod_sensitive
737
+ description: "Changing permissions on sensitive files"
738
+ regex: 'chmod\s+.*\.(ssh|env|pem|key)|chmod\s+777'
739
+ severity: medium
740
+
741
+ - id: 115
742
+ name: chown_escalation
743
+ description: "Changing ownership for privilege escalation"
744
+ regex: 'chown\s+root|chown\s+.*:wheel'
745
+ severity: high
746
+
747
+ - id: 116
748
+ name: setuid_modification
749
+ description: "Setting SUID/SGID bits for privilege escalation"
750
+ regex: 'chmod\s+[u+]?s|chmod\s+[46][0-7]{3}'
751
+ severity: critical