@mcp-shark/mcp-shark 1.5.13 → 1.7.2

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 (158) hide show
  1. package/README.md +482 -56
  2. package/bin/mcp-shark.js +146 -52
  3. package/core/cli/AutoFixEngine.js +93 -0
  4. package/core/cli/ConfigScanner.js +193 -0
  5. package/core/cli/DataLoader.js +200 -0
  6. package/core/cli/DeclarativeRuleEngine.js +363 -0
  7. package/core/cli/DoctorCommand.js +218 -0
  8. package/core/cli/FixHandlers.js +222 -0
  9. package/core/cli/HtmlReportGenerator.js +203 -0
  10. package/core/cli/IdeConfigPaths.js +175 -0
  11. package/core/cli/ListCommand.js +255 -0
  12. package/core/cli/LockCommand.js +164 -0
  13. package/core/cli/LockDiffEngine.js +152 -0
  14. package/core/cli/RuleRegistryConfig.js +131 -0
  15. package/core/cli/ScanCommand.js +244 -0
  16. package/core/cli/ScanService.js +200 -0
  17. package/core/cli/SecretDetector.js +92 -0
  18. package/core/cli/SharkScoreCalculator.js +109 -0
  19. package/core/cli/ToolClassifications.js +51 -0
  20. package/core/cli/ToxicFlowAnalyzer.js +212 -0
  21. package/core/cli/UpdateCommand.js +188 -0
  22. package/core/cli/WalkthroughGenerator.js +195 -0
  23. package/core/cli/WatchCommand.js +129 -0
  24. package/core/cli/YamlRuleEngine.js +197 -0
  25. package/core/cli/data/rule-packs/aauth-visibility.json +117 -0
  26. package/core/cli/data/rule-packs/agentic-security-2026.json +180 -0
  27. package/core/cli/data/rule-packs/general-security.json +173 -0
  28. package/core/cli/data/rule-packs/owasp-mcp-2026.json +244 -0
  29. package/core/cli/data/rule-packs/toxic-flow-heuristics.json +21 -0
  30. package/core/cli/data/rule-sources.json +5 -0
  31. package/core/cli/data/secret-patterns.json +18 -0
  32. package/core/cli/data/tool-classifications.json +111 -0
  33. package/core/cli/data/toxic-flow-rules.json +47 -0
  34. package/core/cli/index.js +23 -0
  35. package/core/cli/output/Banner.js +52 -0
  36. package/core/cli/output/Formatter.js +183 -0
  37. package/core/cli/output/JsonFormatter.js +106 -0
  38. package/core/cli/output/index.js +16 -0
  39. package/core/cli/secureRegistryFetch.js +157 -0
  40. package/core/cli/symbols.js +16 -0
  41. package/core/configs/environment.js +3 -1
  42. package/core/configs/index.js +3 -64
  43. package/core/container/DependencyContainer.js +4 -1
  44. package/core/mcp-server/index.js +4 -1
  45. package/core/mcp-server/server/external/all.js +10 -3
  46. package/core/mcp-server/server/external/config.js +62 -5
  47. package/core/models/RequestFilters.js +3 -0
  48. package/core/repositories/PacketRepository.js +16 -0
  49. package/core/services/AuditService.js +2 -0
  50. package/core/services/ConfigService.js +9 -1
  51. package/core/services/ConfigTransformService.js +34 -2
  52. package/core/services/RequestService.js +58 -5
  53. package/core/services/ServerManagementService.js +59 -4
  54. package/core/services/security/StaticRulesService.js +69 -13
  55. package/core/services/security/TrafficAnalysisService.js +19 -1
  56. package/core/services/security/TrafficToxicFlowService.js +154 -0
  57. package/core/services/security/aauthGraph.js +199 -0
  58. package/core/services/security/aauthParser.js +274 -0
  59. package/core/services/security/aauthSelfTest.js +346 -0
  60. package/core/services/security/index.js +2 -1
  61. package/core/services/security/rules/index.js +25 -59
  62. package/core/services/security/rules/scans/configPermissions.js +91 -0
  63. package/core/services/security/rules/scans/duplicateToolNames.js +85 -0
  64. package/core/services/security/rules/scans/insecureTransport.js +148 -0
  65. package/core/services/security/rules/scans/missingContainment.js +123 -0
  66. package/core/services/security/rules/scans/shellEnvInjection.js +101 -0
  67. package/core/services/security/rules/scans/unsafeDefaults.js +99 -0
  68. package/core/services/security/toolsListFromTrafficParser.js +70 -0
  69. package/core/tui/App.js +144 -0
  70. package/core/tui/FindingsPanel.js +115 -0
  71. package/core/tui/FixPanel.js +132 -0
  72. package/core/tui/Header.js +51 -0
  73. package/core/tui/HelpBar.js +42 -0
  74. package/core/tui/ServersPanel.js +109 -0
  75. package/core/tui/ToxicFlowsPanel.js +100 -0
  76. package/core/tui/h.js +8 -0
  77. package/core/tui/index.js +11 -0
  78. package/core/tui/render.js +22 -0
  79. package/package.json +24 -16
  80. package/ui/dist/assets/index-D6zDrtMV.js +81 -0
  81. package/ui/dist/index.html +1 -1
  82. package/ui/server/controllers/AauthController.js +279 -0
  83. package/ui/server/controllers/RequestController.js +12 -1
  84. package/ui/server/controllers/SecurityFindingsController.js +46 -1
  85. package/ui/server/routes/aauth.js +18 -0
  86. package/ui/server/routes/requests.js +8 -1
  87. package/ui/server/routes/security.js +5 -1
  88. package/ui/server/setup.js +224 -6
  89. package/ui/server/swagger/paths/components.js +55 -0
  90. package/ui/server/swagger/paths/securityTrafficFlows.js +59 -0
  91. package/ui/server/swagger/paths.js +2 -2
  92. package/ui/server/swagger/swagger.js +5 -2
  93. package/ui/server.js +1 -1
  94. package/ui/src/App.jsx +26 -52
  95. package/ui/src/PacketFilters.jsx +31 -1
  96. package/ui/src/PacketList.jsx +2 -2
  97. package/ui/src/Security.jsx +10 -0
  98. package/ui/src/TabNavigation.jsx +8 -0
  99. package/ui/src/components/AAuthBadge.jsx +92 -0
  100. package/ui/src/components/AauthExplorer/AauthExplorerGraph.jsx +231 -0
  101. package/ui/src/components/AauthExplorer/AauthExplorerView.jsx +387 -0
  102. package/ui/src/components/AauthExplorer/NodeDetailPanel.jsx +272 -0
  103. package/ui/src/components/App/ActionMenu.jsx +4 -31
  104. package/ui/src/components/App/ApiDocsButton.jsx +0 -1
  105. package/ui/src/components/App/ShutdownButton.jsx +0 -1
  106. package/ui/src/components/App/useAppState.js +19 -26
  107. package/ui/src/components/DetailsTab/AAuthIdentitySection.jsx +119 -0
  108. package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +2 -0
  109. package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +2 -0
  110. package/ui/src/components/DetectedPathsList.jsx +1 -5
  111. package/ui/src/components/FileInput.jsx +0 -1
  112. package/ui/src/components/PacketFilters/AAuthPostureFilter.jsx +81 -0
  113. package/ui/src/components/RequestRow/RequestRowMain.jsx +7 -1
  114. package/ui/src/components/Security/AAuthPosturePanel.jsx +360 -0
  115. package/ui/src/components/Security/ScannerContent.jsx +33 -1
  116. package/ui/src/components/Security/TrafficToxicFlowsPanel.jsx +253 -0
  117. package/ui/src/components/Security/securityApi.js +15 -0
  118. package/ui/src/components/Security/useSecurity.js +60 -3
  119. package/ui/src/components/ServerControl.jsx +0 -1
  120. package/ui/src/components/TabNavigation/DesktopTabs.jsx +0 -11
  121. package/ui/src/components/TabNavigationIcons.jsx +5 -0
  122. package/ui/src/components/ViewModeTabs.jsx +0 -1
  123. package/ui/src/utils/animations.js +26 -9
  124. package/core/services/security/rules/scans/agentic01GoalHijack.js +0 -130
  125. package/core/services/security/rules/scans/agentic02ToolMisuse.js +0 -129
  126. package/core/services/security/rules/scans/agentic03IdentityAbuse.js +0 -130
  127. package/core/services/security/rules/scans/agentic04SupplyChain.js +0 -130
  128. package/core/services/security/rules/scans/agentic06MemoryPoisoning.js +0 -130
  129. package/core/services/security/rules/scans/agentic07InsecureCommunication.js +0 -135
  130. package/core/services/security/rules/scans/agentic08CascadingFailures.js +0 -135
  131. package/core/services/security/rules/scans/agentic09TrustExploitation.js +0 -135
  132. package/core/services/security/rules/scans/agentic10RogueAgent.js +0 -130
  133. package/core/services/security/rules/scans/hardcodedSecrets.js +0 -130
  134. package/core/services/security/rules/scans/mcp01TokenMismanagement.js +0 -127
  135. package/core/services/security/rules/scans/mcp02ScopeCreep.js +0 -130
  136. package/core/services/security/rules/scans/mcp03ToolPoisoning.js +0 -132
  137. package/core/services/security/rules/scans/mcp04SupplyChain.js +0 -131
  138. package/core/services/security/rules/scans/mcp06PromptInjection.js +0 -200
  139. package/core/services/security/rules/scans/mcp07InsufficientAuth.js +0 -130
  140. package/core/services/security/rules/scans/mcp08LackAudit.js +0 -129
  141. package/core/services/security/rules/scans/mcp09ShadowServers.js +0 -129
  142. package/core/services/security/rules/scans/mcp10ContextInjection.js +0 -130
  143. package/ui/dist/assets/index-CiCSDYf-.js +0 -97
  144. package/ui/server/routes/help.js +0 -44
  145. package/ui/server/swagger/paths/help.js +0 -82
  146. package/ui/src/HelpGuide/HelpGuideContent.jsx +0 -118
  147. package/ui/src/HelpGuide/HelpGuideFooter.jsx +0 -59
  148. package/ui/src/HelpGuide/HelpGuideHeader.jsx +0 -57
  149. package/ui/src/HelpGuide.jsx +0 -78
  150. package/ui/src/IntroTour.jsx +0 -154
  151. package/ui/src/components/App/HelpButton.jsx +0 -90
  152. package/ui/src/components/TourOverlay.jsx +0 -117
  153. package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +0 -120
  154. package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +0 -71
  155. package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +0 -54
  156. package/ui/src/components/TourTooltip/useTooltipPosition.js +0 -135
  157. package/ui/src/components/TourTooltip.jsx +0 -91
  158. package/ui/src/config/tourSteps.jsx +0 -140
@@ -0,0 +1,244 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "pack_id": "owasp-mcp-2026",
4
+ "pack_name": "OWASP MCP Top 10 (2026)",
5
+ "version": "1.0.0",
6
+ "updated": "2026-03-15",
7
+ "source_url": "https://owasp.org/www-project-mcp-top-10/",
8
+ "rules": [
9
+ {
10
+ "id": "mcp01-token-mismanagement",
11
+ "name": "Token Mismanagement & Secret Exposure",
12
+ "owasp_id": "MCP01",
13
+ "severity": "high",
14
+ "type": "owasp-mcp",
15
+ "description": "Detects hard-coded credentials, API keys, and secrets that could be exposed through prompt injection or compromised context.",
16
+ "recommendation": "Move all tokens and secrets to secure storage (environment variables, secret managers). Never embed credentials in MCP server configurations.",
17
+ "scope": ["tool", "prompt", "resource", "packet"],
18
+ "match_mode": "all_matches",
19
+ "severity_overrides": { "prompt": "medium" },
20
+ "patterns": [
21
+ { "regex": "sk-[A-Za-z0-9]{20}T3BlbkFJ[A-Za-z0-9]{20}", "label": "OpenAI", "flags": "" },
22
+ { "regex": "github_pat_[0-9A-Za-z_]{40,90}", "label": "GitHub PAT", "flags": "" },
23
+ { "regex": "(ghp|gho|ghs|ghu)_[A-Za-z0-9]{36}", "label": "GitHub Token", "flags": "" },
24
+ { "regex": "glpat-[0-9A-Za-z\\-_]{20}", "label": "GitLab Token", "flags": "" },
25
+ { "regex": "xox[baprs]-[A-Za-z0-9-]{10,120}", "label": "Slack Token", "flags": "" },
26
+ {
27
+ "regex": "https:\\/\\/hooks\\.slack\\.com\\/services\\/[A-Za-z0-9+/]{30,}",
28
+ "label": "Slack Webhook",
29
+ "flags": ""
30
+ },
31
+ {
32
+ "regex": "[A-Za-z0-9]{24}\\.[A-Za-z0-9]{6}\\.[A-Za-z0-9_-]{27}",
33
+ "label": "Discord Token",
34
+ "flags": ""
35
+ },
36
+ { "regex": "AKIA[0-9A-Z]{16}", "label": "AWS Access Key", "flags": "" },
37
+ {
38
+ "regex": "(?<![A-Za-z0-9])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9])",
39
+ "label": "AWS Secret Key",
40
+ "flags": ""
41
+ },
42
+ { "regex": "AIza[0-9A-Za-z\\-_]{35}", "label": "Google API Key", "flags": "" },
43
+ { "regex": "sk_live_[0-9a-zA-Z]{24}", "label": "Stripe Secret", "flags": "" },
44
+ { "regex": "rk_live_[0-9a-zA-Z]{24}", "label": "Stripe Restricted", "flags": "" },
45
+ { "regex": "SK[0-9a-fA-F]{32}", "label": "Twilio API Key", "flags": "" },
46
+ {
47
+ "regex": "SG\\.[0-9A-Za-z\\-_]{22}\\.[0-9A-Za-z\\-_]{43}",
48
+ "label": "SendGrid",
49
+ "flags": ""
50
+ },
51
+ { "regex": "key-[0-9a-fA-F]{32}", "label": "Mailgun", "flags": "" },
52
+ { "regex": "[A-Z0-9]{32}-[A-Z0-9]{10}", "label": "Algolia", "flags": "" },
53
+ {
54
+ "regex": "heroku[_a-z]*[:=]\\s*['\\\"]?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}",
55
+ "label": "Heroku API token",
56
+ "flags": "i"
57
+ },
58
+ {
59
+ "regex": "pscale_(?:tkn|pw|oauth)_[A-Za-z0-9._=-]{30,60}",
60
+ "label": "PlanetScale",
61
+ "flags": ""
62
+ },
63
+ { "regex": "PMAK-[0-9a-f]{24}-[0-9a-f]{34}", "label": "Postman", "flags": "" },
64
+ { "regex": "AAAA[a-zA-Z0-9_-]{7}:[a-zA-Z0-9_-]{140}", "label": "Firebase", "flags": "" }
65
+ ]
66
+ },
67
+ {
68
+ "id": "mcp02-scope-creep",
69
+ "name": "Scope Creep Detection",
70
+ "owasp_id": "MCP02",
71
+ "severity": "medium",
72
+ "type": "owasp-mcp",
73
+ "description": "Detects potential privilege escalation via scope creep in tool definitions.",
74
+ "recommendation": "Implement strict scope boundaries for tools. Monitor for unauthorized scope expansion and enforce least privilege principles.",
75
+ "scope": ["tool", "prompt", "resource", "packet"],
76
+ "match_mode": "all_matches",
77
+ "severity_overrides": { "prompt": "low" },
78
+ "patterns": [
79
+ "(?:expand|extend|increase|broaden|widen)\\s+(?:scope|permission|access|capability|authority)",
80
+ "(?:additional|extra|more|further)\\s+(?:privilege|permission|access|right)",
81
+ "(?:escalate|elevate|raise|upgrade)\\s+(?:privilege|permission|access|level)",
82
+ "(?:unrestricted|unlimited|full|complete|total)\\s+(?:access|permission|privilege|control)",
83
+ "(?:bypass|override|circumvent)\\s+(?:restriction|limit|constraint|control)"
84
+ ]
85
+ },
86
+ {
87
+ "id": "mcp03-tool-poisoning",
88
+ "name": "Tool Poisoning Detection",
89
+ "owasp_id": "MCP03",
90
+ "severity": "high",
91
+ "type": "owasp-mcp",
92
+ "description": "Detects malicious patterns that could indicate tool poisoning attacks.",
93
+ "recommendation": "Verify tool authenticity and integrity. Implement tool signing and verification mechanisms. Monitor for suspicious tool behavior.",
94
+ "scope": ["tool", "prompt", "resource", "packet"],
95
+ "match_mode": "all_matches",
96
+ "severity_overrides": { "prompt": "medium" },
97
+ "patterns": [
98
+ "(?:malicious|harmful|dangerous|exploit|attack|backdoor|trojan|virus)",
99
+ "(?:unauthorized|illegitimate|fake|spoofed|forged|tampered)",
100
+ "(?:steal|exfiltrate|leak|extract)\\s+(?:data|information|credentials|secrets)",
101
+ "(?:delete|remove|destroy|wipe|erase)\\s+(?:file|data|information)",
102
+ "(?:override|bypass|disable)\\s+(?:security|protection|safeguard|control)",
103
+ "(?:hidden|concealed|obfuscated|encoded)\\s+(?:functionality|behavior|action)"
104
+ ]
105
+ },
106
+ {
107
+ "id": "mcp04-supply-chain",
108
+ "name": "Supply Chain Vulnerability Detection",
109
+ "owasp_id": "MCP04",
110
+ "severity": "high",
111
+ "type": "owasp-mcp",
112
+ "description": "Detects potential supply chain vulnerabilities in MCP configurations.",
113
+ "recommendation": "Pin all dependencies to specific versions. Verify package integrity and signatures. Use trusted repositories and registries.",
114
+ "scope": ["tool", "prompt", "resource", "packet"],
115
+ "match_mode": "all_matches",
116
+ "severity_overrides": { "prompt": "medium" },
117
+ "patterns": [
118
+ "(?:unsigned|unverified|untrusted|unauthenticated)\\s+(?:package|dependency|module|library)",
119
+ "(?:tampered|modified|altered|compromised)\\s+(?:package|dependency|module|library)",
120
+ "(?:dependency|package|module)\\s+(?:confusion|substitution|hijacking)",
121
+ "(?:typosquatting|brandjacking|namespace)\\s+(?:package|dependency|module)",
122
+ "(?:unpinned|floating|wildcard)\\s+(?:version|dependency|package)",
123
+ "(?:from|source)\\s+(?:unknown|unverified|suspicious|untrusted)\\s+(?:source|repository|registry)"
124
+ ]
125
+ },
126
+ {
127
+ "id": "mcp06-prompt-injection",
128
+ "name": "Prompt Injection Detection",
129
+ "owasp_id": "MCP06",
130
+ "severity": "high",
131
+ "type": "owasp-mcp",
132
+ "description": "Detects prompt injection attempts via contextual payloads and suspicious tool names.",
133
+ "recommendation": "Implement prompt injection defenses. Validate and sanitize all user inputs. Use prompt isolation and output filtering.",
134
+ "scope": ["tool", "prompt", "resource", "packet"],
135
+ "match_mode": "all_matches",
136
+ "severity_overrides": { "prompt": "critical" },
137
+ "patterns": [
138
+ "(?:ignore|forget|disregard)\\s+(?:\\w+\\s+)*(?:previous|prior|earlier|above|instructions|prompts|system)",
139
+ "(?:new|different|override|replace)\\s+(?:instructions|prompt|system|rules)",
140
+ "(?:you\\s+are|act\\s+as|pretend\\s+to\\s+be|roleplay\\s+as)",
141
+ "(?:system|admin|root|sudo)\\s+(?:access|privilege|permission|command)",
142
+ "(?:extract|reveal|show|display|output)\\s+(?:system|prompt|instruction|secret|password|token)",
143
+ "(?:execute|run|perform)\\s+(?:arbitrary|any|unrestricted|unlimited)\\s+(?:command|action|code)"
144
+ ],
145
+ "tool_name_patterns": [
146
+ {
147
+ "regex": "instruction_?override",
148
+ "label": "Instruction Override Tool",
149
+ "severity": "critical"
150
+ },
151
+ {
152
+ "regex": "system_?prompt|systemprompt",
153
+ "label": "System Prompt Access Tool",
154
+ "severity": "critical"
155
+ },
156
+ {
157
+ "regex": "ignore_?instruction",
158
+ "label": "Ignore Instruction Tool",
159
+ "severity": "critical"
160
+ },
161
+ { "regex": "bypass_?security", "label": "Security Bypass Tool", "severity": "critical" },
162
+ { "regex": "admin_?override", "label": "Admin Override Tool", "severity": "critical" },
163
+ { "regex": "privilege_?escalat", "label": "Privilege Escalation Tool", "severity": "high" },
164
+ { "regex": "sudo|root_?access", "label": "Elevated Privilege Tool", "severity": "high" },
165
+ { "regex": "hidden_?command", "label": "Hidden Command Tool", "severity": "high" },
166
+ { "regex": "secret_?access", "label": "Secret Access Tool", "severity": "high" }
167
+ ]
168
+ },
169
+ {
170
+ "id": "mcp07-insufficient-auth",
171
+ "name": "Insufficient Authentication Detection",
172
+ "owasp_id": "MCP07",
173
+ "severity": "high",
174
+ "type": "owasp-mcp",
175
+ "description": "Detects potential authentication and authorization weaknesses.",
176
+ "recommendation": "Implement proper authentication and authorization mechanisms. Enforce access controls for all tools and resources.",
177
+ "scope": ["tool", "prompt", "resource", "packet"],
178
+ "match_mode": "all_matches",
179
+ "severity_overrides": { "prompt": "medium" },
180
+ "patterns": [
181
+ "(?:no|missing|lack|absent|without)\\s+(?:authentication|auth|authorization|authz|access\\s+control)",
182
+ "(?:public|open|unrestricted|unprotected|unsecured)\\s+(?:access|endpoint|api|tool|resource)",
183
+ "(?:anonymous|guest|unauthenticated)\\s+(?:user|access|request)",
184
+ "(?:skip|bypass|ignore|disable)\\s+(?:authentication|auth|authorization|check|validation)",
185
+ "(?:weak|insecure|poor|insufficient)\\s+(?:authentication|auth|authorization|security)"
186
+ ]
187
+ },
188
+ {
189
+ "id": "mcp08-lack-audit",
190
+ "name": "Lack of Audit Detection",
191
+ "owasp_id": "MCP08",
192
+ "severity": "medium",
193
+ "type": "owasp-mcp",
194
+ "description": "Detects potential lack of audit trails and telemetry.",
195
+ "recommendation": "Implement comprehensive logging, audit trails, and telemetry. Monitor all tool usage and resource access.",
196
+ "scope": ["tool", "prompt", "resource", "packet"],
197
+ "match_mode": "all_matches",
198
+ "severity_overrides": { "prompt": "low" },
199
+ "patterns": [
200
+ "(?:no|missing|lack|absent|without)\\s+(?:logging|log|audit|telemetry|monitoring|tracking)",
201
+ "(?:disable|turn\\s+off|remove)\\s+(?:logging|log|audit|telemetry|monitoring)",
202
+ "(?:silent|quiet|no\\s+output)\\s+(?:mode|operation|execution)",
203
+ "(?:unlogged|unmonitored|untracked)\\s+(?:action|operation|event|access)"
204
+ ]
205
+ },
206
+ {
207
+ "id": "mcp09-shadow-servers",
208
+ "name": "Shadow Server Detection",
209
+ "owasp_id": "MCP09",
210
+ "severity": "high",
211
+ "type": "owasp-mcp",
212
+ "description": "Detects potential unauthorized or shadow MCP server deployments.",
213
+ "recommendation": "Maintain an inventory of all MCP servers. Implement server registration and approval processes. Monitor for unauthorized deployments.",
214
+ "scope": ["tool", "prompt", "resource", "packet"],
215
+ "match_mode": "all_matches",
216
+ "severity_overrides": { "prompt": "medium" },
217
+ "patterns": [
218
+ "(?:unauthorized|unmanaged|unapproved|unofficial)\\s+(?:server|service|instance|deployment)",
219
+ "(?:shadow|rogue|hidden|concealed|undocumented)\\s+(?:server|service|instance|deployment)",
220
+ "(?:bypass|circumvent|avoid)\\s+(?:approval|review|governance|management|control)",
221
+ "(?:unregistered|unlisted|unmonitored)\\s+(?:server|service|instance|deployment)"
222
+ ]
223
+ },
224
+ {
225
+ "id": "mcp10-context-injection",
226
+ "name": "Context Injection Detection",
227
+ "owasp_id": "MCP10",
228
+ "severity": "medium",
229
+ "type": "owasp-mcp",
230
+ "description": "Detects context injection and over-sharing vulnerabilities.",
231
+ "recommendation": "Implement context isolation and filtering. Limit context sharing between tools and servers. Validate all context data.",
232
+ "scope": ["tool", "prompt", "resource", "packet"],
233
+ "match_mode": "all_matches",
234
+ "severity_overrides": { "prompt": "high" },
235
+ "patterns": [
236
+ "(?:over-share|overshare|excessive|too\\s+much)\\s+(?:context|information|data|details)",
237
+ "(?:share|expose|reveal|leak)\\s+(?:all|entire|full|complete|everything)\\s+(?:context|information|data)",
238
+ "(?:inject|insert)\\s+(?:context|information|data|payload)\\s+(?:into|to|in)",
239
+ "(?:context|information|data)\\s+(?:injection|manipulation|tampering|poisoning)",
240
+ "(?:unrestricted|unlimited|unfiltered)\\s+(?:context|information|data)\\s+(?:sharing|access|transfer)"
241
+ ]
242
+ }
243
+ ]
244
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "pack_id": "toxic-flow-heuristics",
4
+ "pack_name": "Toxic flow capability-pair heuristics",
5
+ "version": "1.0.0",
6
+ "updated": "2026-04-05",
7
+ "source_url": "https://github.com/mcp-shark/rule-packs",
8
+ "description": "Cross-server toxic flow rules consumed by analyzeToxicFlows (CLI, HTML report, proxy traffic panel). Declarative rules[] is empty; heuristics live in toxic_flow_rules.",
9
+ "rules": [],
10
+ "toxic_flow_rules": [
11
+ {
12
+ "source": "writes_code",
13
+ "target": "sends_external",
14
+ "risk": "HIGH",
15
+ "title": "Code change \u2192 external disclosure",
16
+ "scenario": "The agent could alter code or repos via {source} and leak implementation details, tokens, or other sensitive context through {target}.",
17
+ "catalog": "\u00a71.2, \u00a71.10",
18
+ "owasp": "MCP03 + MCP06"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "registry_url": "https://raw.githubusercontent.com/mcp-shark/rule-packs/main/manifest.json",
3
+ "cache_dir": ".mcp-shark/rule-packs",
4
+ "default_auto_update_max_age_hours": 168
5
+ }
@@ -0,0 +1,18 @@
1
+ [
2
+ { "pattern": "^ghp_[a-zA-Z0-9]{36,}$", "name": "GitHub PAT", "severity": "high" },
3
+ { "pattern": "^gho_[a-zA-Z0-9]{36,}$", "name": "GitHub OAuth", "severity": "high" },
4
+ { "pattern": "^sk-[a-zA-Z0-9]{20,}$", "name": "API Key (sk-)", "severity": "high" },
5
+ { "pattern": "^xoxb-", "name": "Slack Bot Token", "severity": "high" },
6
+ { "pattern": "^xoxp-", "name": "Slack User Token", "severity": "critical" },
7
+ { "pattern": "^AKIA[A-Z0-9]{16}$", "name": "AWS Access Key", "severity": "critical" },
8
+ { "pattern": "^glpat-", "name": "GitLab PAT", "severity": "high" },
9
+ { "pattern": "^npm_[a-zA-Z0-9]{36,}$", "name": "npm Token", "severity": "high" },
10
+ { "pattern": "^[a-f0-9]{40}$", "name": "Hex Token (40 chars)", "severity": "medium" },
11
+ { "pattern": "^AIza[a-zA-Z0-9_-]{35}$", "name": "Google API Key", "severity": "high" },
12
+ {
13
+ "pattern": "^SG\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$",
14
+ "name": "SendGrid Key",
15
+ "severity": "high"
16
+ },
17
+ { "pattern": "^sk_live_[a-zA-Z0-9]+$", "name": "Stripe Live Key", "severity": "critical" }
18
+ ]
@@ -0,0 +1,111 @@
1
+ {
2
+ "mcp-server-github": {
3
+ "get_issue": "ingests_untrusted",
4
+ "get_pull_request": "ingests_untrusted",
5
+ "search_issues": "ingests_untrusted",
6
+ "list_issues": "ingests_untrusted",
7
+ "search_code": "ingests_untrusted",
8
+ "get_file_contents": "reads_secrets",
9
+ "create_pull_request": "writes_code",
10
+ "push_files": "writes_code",
11
+ "create_issue": "writes_code",
12
+ "update_issue": "writes_code",
13
+ "create_or_update_file": "writes_code",
14
+ "fork_repository": "writes_code",
15
+ "create_branch": "writes_code"
16
+ },
17
+ "mcp-server-slack": {
18
+ "list_messages": "ingests_untrusted",
19
+ "get_channel_history": "ingests_untrusted",
20
+ "search_messages": "ingests_untrusted",
21
+ "send_message": "sends_external",
22
+ "post_message": "sends_external",
23
+ "upload_file": "sends_external"
24
+ },
25
+ "mcp-server-filesystem": {
26
+ "read_file": "reads_secrets",
27
+ "read_multiple_files": "reads_secrets",
28
+ "list_directory": "reads_secrets",
29
+ "search_files": "reads_secrets",
30
+ "get_file_info": "reads_secrets",
31
+ "write_file": "writes_code",
32
+ "create_directory": "writes_code",
33
+ "move_file": "writes_code",
34
+ "edit_file": "writes_code"
35
+ },
36
+ "mcp-server-git": {
37
+ "git_log": "reads_secrets",
38
+ "git_diff": "reads_secrets",
39
+ "git_status": "reads_secrets",
40
+ "git_show": "reads_secrets",
41
+ "git_commit": "writes_code",
42
+ "git_add": "writes_code",
43
+ "git_push": "writes_code",
44
+ "git_init": "writes_code"
45
+ },
46
+ "mcp-server-postgres": {
47
+ "query": "reads_secrets",
48
+ "list_tables": "reads_secrets",
49
+ "describe_table": "reads_secrets"
50
+ },
51
+ "mcp-server-sqlite": {
52
+ "read_query": "reads_secrets",
53
+ "write_query": "writes_code",
54
+ "list_tables": "reads_secrets"
55
+ },
56
+ "mcp-server-fetch": {
57
+ "fetch": "ingests_untrusted"
58
+ },
59
+ "mcp-server-brave-search": {
60
+ "brave_web_search": "ingests_untrusted",
61
+ "brave_local_search": "ingests_untrusted"
62
+ },
63
+ "mcp-server-puppeteer": {
64
+ "navigate": "ingests_untrusted",
65
+ "screenshot": "ingests_untrusted",
66
+ "click": "ingests_untrusted",
67
+ "evaluate": "writes_code"
68
+ },
69
+ "@playwright/mcp": {
70
+ "browser_navigate": "ingests_untrusted",
71
+ "browser_snapshot": "ingests_untrusted",
72
+ "browser_click": "ingests_untrusted",
73
+ "browser_type": "ingests_untrusted"
74
+ },
75
+ "mcp-server-kubernetes": {
76
+ "kubectl_get": "reads_secrets",
77
+ "kubectl_apply": "modifies_infra",
78
+ "kubectl_delete": "modifies_infra",
79
+ "kubectl_scale": "modifies_infra",
80
+ "kubectl_patch": "modifies_infra"
81
+ },
82
+ "heroku-mcp-server": {
83
+ "list_apps": "reads_secrets",
84
+ "transfer_app": "modifies_infra",
85
+ "scale_formation": "modifies_infra",
86
+ "create_app": "modifies_infra",
87
+ "delete_app": "modifies_infra"
88
+ },
89
+ "mcp-server-docker": {
90
+ "list_containers": "reads_secrets",
91
+ "container_run": "modifies_infra",
92
+ "container_stop": "modifies_infra",
93
+ "container_remove": "modifies_infra",
94
+ "image_pull": "modifies_infra"
95
+ },
96
+ "google-docs-mcp": {
97
+ "get_document": "ingests_untrusted",
98
+ "search_documents": "ingests_untrusted",
99
+ "create_document": "writes_code"
100
+ },
101
+ "jira-mcp-server": {
102
+ "get_issue": "ingests_untrusted",
103
+ "search_issues": "ingests_untrusted",
104
+ "get_ticket": "ingests_untrusted",
105
+ "create_issue": "writes_code"
106
+ },
107
+ "mcp-server-memory": {
108
+ "store": "writes_code",
109
+ "retrieve": "reads_secrets"
110
+ }
111
+ }
@@ -0,0 +1,47 @@
1
+ [
2
+ {
3
+ "source": "ingests_untrusted",
4
+ "target": "writes_code",
5
+ "risk": "HIGH",
6
+ "title": "Prompt injection \u2192 code modification",
7
+ "scenario": "A {source_ide} message with prompt injection processed by {source} could cause your agent to push malicious code via {target}.",
8
+ "catalog": "\u00a71.3, \u00a71.10, \u00a71.12",
9
+ "owasp": "MCP03 + MCP10"
10
+ },
11
+ {
12
+ "source": "ingests_untrusted",
13
+ "target": "sends_external",
14
+ "risk": "HIGH",
15
+ "title": "Prompt injection \u2192 data exfiltration",
16
+ "scenario": "Untrusted content ingested by {source} could instruct the agent to exfiltrate sensitive data through {target}.",
17
+ "catalog": "\u00a71.2",
18
+ "owasp": "MCP03 + MCP06"
19
+ },
20
+ {
21
+ "source": "reads_secrets",
22
+ "target": "sends_external",
23
+ "risk": "HIGH",
24
+ "title": "Secret theft via external channel",
25
+ "scenario": "Your agent can read sensitive files via {source} and exfiltrate them through {target}.",
26
+ "catalog": "\u00a71.1, \u00a71.14",
27
+ "owasp": "MCP01 + MCP10"
28
+ },
29
+ {
30
+ "source": "ingests_untrusted",
31
+ "target": "modifies_infra",
32
+ "risk": "HIGH",
33
+ "title": "Prompt injection \u2192 infrastructure takeover",
34
+ "scenario": "Attacker-controlled content from {source} could cause infrastructure changes via {target}.",
35
+ "catalog": "\u00a71.13",
36
+ "owasp": "MCP03 + MCP05"
37
+ },
38
+ {
39
+ "source": "reads_secrets",
40
+ "target": "ingests_untrusted",
41
+ "risk": "MEDIUM",
42
+ "title": "Sensitive data leakage to untrusted channel",
43
+ "scenario": "Sensitive data from {source} could leak into context shared with untrusted content from {target}.",
44
+ "catalog": "\u00a71.7",
45
+ "owasp": "MCP10"
46
+ }
47
+ ]
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CLI module barrel file
3
+ */
4
+ export { applyFixes, renderFixResults } from './AutoFixEngine.js';
5
+ export { scanIdeConfigs, getAllServers } from './ConfigScanner.js';
6
+ export { loadBuiltinJson, loadUserYamlList, loadUserYamlMap } from './DataLoader.js';
7
+ export { loadDeclarativeRules } from './DeclarativeRuleEngine.js';
8
+ export { executeDoctor } from './DoctorCommand.js';
9
+ export { applyFix, createEnvExample, undoFixes } from './FixHandlers.js';
10
+ export { generateHtmlReport } from './HtmlReportGenerator.js';
11
+ export { executeList } from './ListCommand.js';
12
+ export { computeDiff, renderDiff, hashToolDefinition } from './LockDiffEngine.js';
13
+ export { executeLock, executeLockVerify, executeDiff } from './LockCommand.js';
14
+ export { executeScan } from './ScanCommand.js';
15
+ export { runScan } from './ScanService.js';
16
+ export { detectHardcodedSecrets } from './SecretDetector.js';
17
+ export { S } from './symbols.js';
18
+ export { calculateSharkScore, countBySeverity } from './SharkScoreCalculator.js';
19
+ export { analyzeToxicFlows } from './ToxicFlowAnalyzer.js';
20
+ export { executeUpdateRules } from './UpdateCommand.js';
21
+ export { executeWatch } from './WatchCommand.js';
22
+ export { generateWalkthroughs } from './WalkthroughGenerator.js';
23
+ export { loadYamlRules, applyYamlRules } from './YamlRuleEngine.js';
@@ -0,0 +1,52 @@
1
+ /**
2
+ * CLI banner — clean, text-only
3
+ */
4
+ import { readFileSync } from 'node:fs';
5
+ import { dirname, join, resolve } from 'node:path';
6
+ import { fileURLToPath } from 'node:url';
7
+ import kleur from 'kleur';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const rootDir = resolve(__dirname, '..', '..', '..');
12
+
13
+ function getVersion() {
14
+ try {
15
+ const pkgPath = join(rootDir, 'package.json');
16
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
17
+ return pkg.version;
18
+ } catch (_err) {
19
+ return 'unknown';
20
+ }
21
+ }
22
+
23
+ /**
24
+ * Display the scan banner — minimal, Biome-style
25
+ */
26
+ export function displayScanBanner() {
27
+ const version = getVersion();
28
+
29
+ console.log('');
30
+ console.log(` ${kleur.bold('mcp-shark')} ${kleur.dim(`v${version}`)}`);
31
+ console.log(kleur.dim(' ─────────────────────────────────────'));
32
+ console.log('');
33
+ }
34
+
35
+ /**
36
+ * Display the serve banner (existing ASCII art style)
37
+ */
38
+ export function displayServeBanner() {
39
+ const version = getVersion();
40
+ const banner = `
41
+ ███╗ ███╗ ██████╗ ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ██╗ ██╗
42
+ ████╗ ████║██╔════╝██╔══██╗ ██╔════╝██║ ██║██╔══██╗██╔══██╗██║ ██╔╝
43
+ ██╔████╔██║██║ ██████╔╝ ███████╗███████║███████║██████╔╝█████╔╝
44
+ ██║╚██╔╝██║██║ ██╔═══╝ ╚════██║██╔══██║██╔══██║██╔══██╗██╔═██╗
45
+ ██║ ╚═╝ ██║╚██████╗██║ ███████║██║ ██║██║ ██║██║ ██║██║ ██╗
46
+ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
47
+
48
+ Aggregate multiple MCP servers into a unified interface
49
+ Version: ${version} | Homepage: https://mcpshark.sh
50
+ `;
51
+ console.log(banner);
52
+ }