@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.
- package/README.md +482 -56
- package/bin/mcp-shark.js +146 -52
- package/core/cli/AutoFixEngine.js +93 -0
- package/core/cli/ConfigScanner.js +193 -0
- package/core/cli/DataLoader.js +200 -0
- package/core/cli/DeclarativeRuleEngine.js +363 -0
- package/core/cli/DoctorCommand.js +218 -0
- package/core/cli/FixHandlers.js +222 -0
- package/core/cli/HtmlReportGenerator.js +203 -0
- package/core/cli/IdeConfigPaths.js +175 -0
- package/core/cli/ListCommand.js +255 -0
- package/core/cli/LockCommand.js +164 -0
- package/core/cli/LockDiffEngine.js +152 -0
- package/core/cli/RuleRegistryConfig.js +131 -0
- package/core/cli/ScanCommand.js +244 -0
- package/core/cli/ScanService.js +200 -0
- package/core/cli/SecretDetector.js +92 -0
- package/core/cli/SharkScoreCalculator.js +109 -0
- package/core/cli/ToolClassifications.js +51 -0
- package/core/cli/ToxicFlowAnalyzer.js +212 -0
- package/core/cli/UpdateCommand.js +188 -0
- package/core/cli/WalkthroughGenerator.js +195 -0
- package/core/cli/WatchCommand.js +129 -0
- package/core/cli/YamlRuleEngine.js +197 -0
- package/core/cli/data/rule-packs/aauth-visibility.json +117 -0
- package/core/cli/data/rule-packs/agentic-security-2026.json +180 -0
- package/core/cli/data/rule-packs/general-security.json +173 -0
- package/core/cli/data/rule-packs/owasp-mcp-2026.json +244 -0
- package/core/cli/data/rule-packs/toxic-flow-heuristics.json +21 -0
- package/core/cli/data/rule-sources.json +5 -0
- package/core/cli/data/secret-patterns.json +18 -0
- package/core/cli/data/tool-classifications.json +111 -0
- package/core/cli/data/toxic-flow-rules.json +47 -0
- package/core/cli/index.js +23 -0
- package/core/cli/output/Banner.js +52 -0
- package/core/cli/output/Formatter.js +183 -0
- package/core/cli/output/JsonFormatter.js +106 -0
- package/core/cli/output/index.js +16 -0
- package/core/cli/secureRegistryFetch.js +157 -0
- package/core/cli/symbols.js +16 -0
- package/core/configs/environment.js +3 -1
- package/core/configs/index.js +3 -64
- package/core/container/DependencyContainer.js +4 -1
- package/core/mcp-server/index.js +4 -1
- package/core/mcp-server/server/external/all.js +10 -3
- package/core/mcp-server/server/external/config.js +62 -5
- package/core/models/RequestFilters.js +3 -0
- package/core/repositories/PacketRepository.js +16 -0
- package/core/services/AuditService.js +2 -0
- package/core/services/ConfigService.js +9 -1
- package/core/services/ConfigTransformService.js +34 -2
- package/core/services/RequestService.js +58 -5
- package/core/services/ServerManagementService.js +59 -4
- package/core/services/security/StaticRulesService.js +69 -13
- package/core/services/security/TrafficAnalysisService.js +19 -1
- package/core/services/security/TrafficToxicFlowService.js +154 -0
- package/core/services/security/aauthGraph.js +199 -0
- package/core/services/security/aauthParser.js +274 -0
- package/core/services/security/aauthSelfTest.js +346 -0
- package/core/services/security/index.js +2 -1
- package/core/services/security/rules/index.js +25 -59
- package/core/services/security/rules/scans/configPermissions.js +91 -0
- package/core/services/security/rules/scans/duplicateToolNames.js +85 -0
- package/core/services/security/rules/scans/insecureTransport.js +148 -0
- package/core/services/security/rules/scans/missingContainment.js +123 -0
- package/core/services/security/rules/scans/shellEnvInjection.js +101 -0
- package/core/services/security/rules/scans/unsafeDefaults.js +99 -0
- package/core/services/security/toolsListFromTrafficParser.js +70 -0
- package/core/tui/App.js +144 -0
- package/core/tui/FindingsPanel.js +115 -0
- package/core/tui/FixPanel.js +132 -0
- package/core/tui/Header.js +51 -0
- package/core/tui/HelpBar.js +42 -0
- package/core/tui/ServersPanel.js +109 -0
- package/core/tui/ToxicFlowsPanel.js +100 -0
- package/core/tui/h.js +8 -0
- package/core/tui/index.js +11 -0
- package/core/tui/render.js +22 -0
- package/package.json +24 -16
- package/ui/dist/assets/index-D6zDrtMV.js +81 -0
- package/ui/dist/index.html +1 -1
- package/ui/server/controllers/AauthController.js +279 -0
- package/ui/server/controllers/RequestController.js +12 -1
- package/ui/server/controllers/SecurityFindingsController.js +46 -1
- package/ui/server/routes/aauth.js +18 -0
- package/ui/server/routes/requests.js +8 -1
- package/ui/server/routes/security.js +5 -1
- package/ui/server/setup.js +224 -6
- package/ui/server/swagger/paths/components.js +55 -0
- package/ui/server/swagger/paths/securityTrafficFlows.js +59 -0
- package/ui/server/swagger/paths.js +2 -2
- package/ui/server/swagger/swagger.js +5 -2
- package/ui/server.js +1 -1
- package/ui/src/App.jsx +26 -52
- package/ui/src/PacketFilters.jsx +31 -1
- package/ui/src/PacketList.jsx +2 -2
- package/ui/src/Security.jsx +10 -0
- package/ui/src/TabNavigation.jsx +8 -0
- package/ui/src/components/AAuthBadge.jsx +92 -0
- package/ui/src/components/AauthExplorer/AauthExplorerGraph.jsx +231 -0
- package/ui/src/components/AauthExplorer/AauthExplorerView.jsx +387 -0
- package/ui/src/components/AauthExplorer/NodeDetailPanel.jsx +272 -0
- package/ui/src/components/App/ActionMenu.jsx +4 -31
- package/ui/src/components/App/ApiDocsButton.jsx +0 -1
- package/ui/src/components/App/ShutdownButton.jsx +0 -1
- package/ui/src/components/App/useAppState.js +19 -26
- package/ui/src/components/DetailsTab/AAuthIdentitySection.jsx +119 -0
- package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +2 -0
- package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +2 -0
- package/ui/src/components/DetectedPathsList.jsx +1 -5
- package/ui/src/components/FileInput.jsx +0 -1
- package/ui/src/components/PacketFilters/AAuthPostureFilter.jsx +81 -0
- package/ui/src/components/RequestRow/RequestRowMain.jsx +7 -1
- package/ui/src/components/Security/AAuthPosturePanel.jsx +360 -0
- package/ui/src/components/Security/ScannerContent.jsx +33 -1
- package/ui/src/components/Security/TrafficToxicFlowsPanel.jsx +253 -0
- package/ui/src/components/Security/securityApi.js +15 -0
- package/ui/src/components/Security/useSecurity.js +60 -3
- package/ui/src/components/ServerControl.jsx +0 -1
- package/ui/src/components/TabNavigation/DesktopTabs.jsx +0 -11
- package/ui/src/components/TabNavigationIcons.jsx +5 -0
- package/ui/src/components/ViewModeTabs.jsx +0 -1
- package/ui/src/utils/animations.js +26 -9
- package/core/services/security/rules/scans/agentic01GoalHijack.js +0 -130
- package/core/services/security/rules/scans/agentic02ToolMisuse.js +0 -129
- package/core/services/security/rules/scans/agentic03IdentityAbuse.js +0 -130
- package/core/services/security/rules/scans/agentic04SupplyChain.js +0 -130
- package/core/services/security/rules/scans/agentic06MemoryPoisoning.js +0 -130
- package/core/services/security/rules/scans/agentic07InsecureCommunication.js +0 -135
- package/core/services/security/rules/scans/agentic08CascadingFailures.js +0 -135
- package/core/services/security/rules/scans/agentic09TrustExploitation.js +0 -135
- package/core/services/security/rules/scans/agentic10RogueAgent.js +0 -130
- package/core/services/security/rules/scans/hardcodedSecrets.js +0 -130
- package/core/services/security/rules/scans/mcp01TokenMismanagement.js +0 -127
- package/core/services/security/rules/scans/mcp02ScopeCreep.js +0 -130
- package/core/services/security/rules/scans/mcp03ToolPoisoning.js +0 -132
- package/core/services/security/rules/scans/mcp04SupplyChain.js +0 -131
- package/core/services/security/rules/scans/mcp06PromptInjection.js +0 -200
- package/core/services/security/rules/scans/mcp07InsufficientAuth.js +0 -130
- package/core/services/security/rules/scans/mcp08LackAudit.js +0 -129
- package/core/services/security/rules/scans/mcp09ShadowServers.js +0 -129
- package/core/services/security/rules/scans/mcp10ContextInjection.js +0 -130
- package/ui/dist/assets/index-CiCSDYf-.js +0 -97
- package/ui/server/routes/help.js +0 -44
- package/ui/server/swagger/paths/help.js +0 -82
- package/ui/src/HelpGuide/HelpGuideContent.jsx +0 -118
- package/ui/src/HelpGuide/HelpGuideFooter.jsx +0 -59
- package/ui/src/HelpGuide/HelpGuideHeader.jsx +0 -57
- package/ui/src/HelpGuide.jsx +0 -78
- package/ui/src/IntroTour.jsx +0 -154
- package/ui/src/components/App/HelpButton.jsx +0 -90
- package/ui/src/components/TourOverlay.jsx +0 -117
- package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +0 -120
- package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +0 -71
- package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +0 -54
- package/ui/src/components/TourTooltip/useTooltipPosition.js +0 -135
- package/ui/src/components/TourTooltip.jsx +0 -91
- package/ui/src/config/tourSteps.jsx +0 -140
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"pack_id": "aauth-visibility",
|
|
4
|
+
"pack_name": "AAuth Visibility",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"updated": "2026-04-26",
|
|
7
|
+
"source_url": "https://github.com/dickhardt/AAuth",
|
|
8
|
+
"rules": [
|
|
9
|
+
{
|
|
10
|
+
"id": "aauth-agent-identity-observed",
|
|
11
|
+
"name": "AAuth Agent Identity Observed",
|
|
12
|
+
"owasp_id": "INFO",
|
|
13
|
+
"severity": "low",
|
|
14
|
+
"type": "aauth-visibility",
|
|
15
|
+
"description": "An AAuth agent identifier (aauth:local@domain) was observed in metadata. This is informational only — mcp-shark does not verify cryptographic identity.",
|
|
16
|
+
"recommendation": "Confirm the agent identifier is expected for this server. See https://www.aauth.dev for background on AAuth agent identities.",
|
|
17
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
18
|
+
"match_mode": "first",
|
|
19
|
+
"patterns": [
|
|
20
|
+
{
|
|
21
|
+
"regex": "aauth:[A-Za-z0-9._-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}",
|
|
22
|
+
"label": "AAuth agent ID",
|
|
23
|
+
"flags": ""
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "aauth-jwks-discovery-url",
|
|
29
|
+
"name": "AAuth JWKS or Well-Known URL Observed",
|
|
30
|
+
"owasp_id": "INFO",
|
|
31
|
+
"severity": "low",
|
|
32
|
+
"type": "aauth-visibility",
|
|
33
|
+
"description": "A JWKS or .well-known/aauth URL was observed. This typically indicates the resource is AAuth-aware.",
|
|
34
|
+
"recommendation": "If this URL is unexpected, investigate which agent or resource is publishing it.",
|
|
35
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
36
|
+
"match_mode": "first",
|
|
37
|
+
"patterns": [
|
|
38
|
+
{ "regex": "/\\.well-known/aauth", "label": ".well-known/aauth path", "flags": "i" },
|
|
39
|
+
{ "regex": "https?://[^\\s\"']+/jwks(?:\\.json)?", "label": "JWKS URL", "flags": "i" }
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "aauth-http-message-signature-observed",
|
|
44
|
+
"name": "HTTP Message Signature Observed",
|
|
45
|
+
"owasp_id": "INFO",
|
|
46
|
+
"severity": "low",
|
|
47
|
+
"type": "aauth-visibility",
|
|
48
|
+
"description": "An RFC 9421 HTTP Message Signature appears in captured traffic. mcp-shark records this as observed only — it does not verify the signature.",
|
|
49
|
+
"recommendation": "Use an AAuth-capable verifier to confirm signature validity. mcp-shark's role here is observability.",
|
|
50
|
+
"scope": ["packet"],
|
|
51
|
+
"match_mode": "first",
|
|
52
|
+
"patterns": [
|
|
53
|
+
{
|
|
54
|
+
"regex": "\"signature-input\"\\s*:\\s*\"[^\"]+\"",
|
|
55
|
+
"label": "Signature-Input header",
|
|
56
|
+
"flags": "i"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"regex": "\"signature\"\\s*:\\s*\"[^\"]*=:[A-Za-z0-9+/=]+:\"",
|
|
60
|
+
"label": "Signature header (sf-binary)",
|
|
61
|
+
"flags": "i"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "aauth-mission-context-observed",
|
|
67
|
+
"name": "AAuth Mission Context Observed",
|
|
68
|
+
"owasp_id": "INFO",
|
|
69
|
+
"severity": "low",
|
|
70
|
+
"type": "aauth-visibility",
|
|
71
|
+
"description": "An AAuth-Mission header was observed in captured traffic. Missions group calls under a single user-consented scope.",
|
|
72
|
+
"recommendation": "Use the mission timeline view in the UI to inspect related calls under the same mission.",
|
|
73
|
+
"scope": ["packet"],
|
|
74
|
+
"match_mode": "first",
|
|
75
|
+
"patterns": [
|
|
76
|
+
{ "regex": "\"aauth-mission\"\\s*:", "label": "AAuth-Mission header", "flags": "i" }
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "aauth-requirement-challenge-observed",
|
|
81
|
+
"name": "AAuth Requirement Challenge Observed",
|
|
82
|
+
"owasp_id": "INFO",
|
|
83
|
+
"severity": "low",
|
|
84
|
+
"type": "aauth-visibility",
|
|
85
|
+
"description": "An AAuth-Requirement response header was observed. The resource is asking the client to upgrade to AAuth.",
|
|
86
|
+
"recommendation": "If you control the calling agent, consider upgrading to AAuth — see https://www.aauth.dev.",
|
|
87
|
+
"scope": ["packet"],
|
|
88
|
+
"match_mode": "first",
|
|
89
|
+
"patterns": [
|
|
90
|
+
{ "regex": "\"aauth-requirement\"\\s*:", "label": "AAuth-Requirement header", "flags": "i" }
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"id": "aauth-bearer-token-coexists-with-aauth",
|
|
95
|
+
"name": "Bearer Token Coexists With AAuth Headers",
|
|
96
|
+
"owasp_id": "MCP01",
|
|
97
|
+
"severity": "medium",
|
|
98
|
+
"type": "aauth-visibility",
|
|
99
|
+
"description": "A request carries both a Bearer token and AAuth identity headers. AAuth replaces bearer credentials — coexisting both is the worst-of-both-worlds pattern called out by the AAuth project.",
|
|
100
|
+
"recommendation": "Migrate the calling agent fully to AAuth; remove the long-lived bearer token once signed identity is in place.",
|
|
101
|
+
"scope": ["packet"],
|
|
102
|
+
"match_mode": "all_matches",
|
|
103
|
+
"patterns": [
|
|
104
|
+
{
|
|
105
|
+
"regex": "\"authorization\"\\s*:\\s*\"Bearer\\s+[^\"]+\"[\\s\\S]*\"signature-input\"",
|
|
106
|
+
"label": "Bearer + Signature-Input",
|
|
107
|
+
"flags": "i"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"regex": "\"signature-input\"[\\s\\S]*\"authorization\"\\s*:\\s*\"Bearer",
|
|
111
|
+
"label": "Signature-Input + Bearer",
|
|
112
|
+
"flags": "i"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"pack_id": "agentic-security-2026",
|
|
4
|
+
"pack_name": "Agentic Security Initiative (2026)",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"updated": "2026-03-15",
|
|
7
|
+
"source_url": "https://owasp.org/www-project-agentic-security/",
|
|
8
|
+
"rules": [
|
|
9
|
+
{
|
|
10
|
+
"id": "asi01-goal-hijack",
|
|
11
|
+
"name": "Agent Goal Hijack Detection",
|
|
12
|
+
"owasp_id": "ASI01",
|
|
13
|
+
"severity": "high",
|
|
14
|
+
"type": "agentic-security",
|
|
15
|
+
"description": "Detects attempts to hijack or modify agent goals.",
|
|
16
|
+
"recommendation": "Implement goal validation and verification. Monitor for unauthorized goal changes. Use goal isolation and protection mechanisms.",
|
|
17
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
18
|
+
"match_mode": "all_matches",
|
|
19
|
+
"severity_overrides": { "prompt": "critical" },
|
|
20
|
+
"patterns": [
|
|
21
|
+
"(?:hijack|override|replace|change|modify)\\s+(?:goal|objective|purpose|mission|task)",
|
|
22
|
+
"(?:ignore|forget|disregard)\\s+(?:original|initial|intended|primary)\\s+(?:goal|objective|purpose)",
|
|
23
|
+
"(?:new|different|alternative|malicious)\\s+(?:goal|objective|purpose|mission)",
|
|
24
|
+
"(?:steer|redirect|manipulate)\\s+(?:agent|system)\\s+(?:toward|to|into)",
|
|
25
|
+
"(?:unauthorized|malicious|harmful)\\s+(?:goal|objective|purpose|action)"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "asi02-tool-misuse",
|
|
30
|
+
"name": "Tool Misuse Detection",
|
|
31
|
+
"owasp_id": "ASI02",
|
|
32
|
+
"severity": "high",
|
|
33
|
+
"type": "agentic-security",
|
|
34
|
+
"description": "Detects tool misuse and exploitation patterns.",
|
|
35
|
+
"recommendation": "Implement tool usage monitoring and restrictions. Enforce scope boundaries for tool usage. Monitor for unauthorized tool combinations.",
|
|
36
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
37
|
+
"match_mode": "all_matches",
|
|
38
|
+
"severity_overrides": { "resource": "medium" },
|
|
39
|
+
"patterns": [
|
|
40
|
+
"(?:misuse|abuse|exploit|manipulate)\\s+(?:tool|function|capability|feature)",
|
|
41
|
+
"(?:use|utilize|invoke)\\s+(?:tool|function)\\s+(?:outside|beyond|outside\\s+of)\\s+(?:intended|authorized|allowed)\\s+(?:scope|purpose|context)",
|
|
42
|
+
"(?:unauthorized|illegitimate|improper)\\s+(?:tool|function)\\s+(?:usage|use|invocation)",
|
|
43
|
+
"(?:combine|chain|sequence)\\s+(?:tools|functions)\\s+(?:to|for)\\s+(?:achieve|perform|execute)\\s+(?:unauthorized|malicious)"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "asi03-identity-abuse",
|
|
48
|
+
"name": "Identity Abuse Detection",
|
|
49
|
+
"owasp_id": "ASI03",
|
|
50
|
+
"severity": "high",
|
|
51
|
+
"type": "agentic-security",
|
|
52
|
+
"description": "Detects identity and privilege abuse patterns.",
|
|
53
|
+
"recommendation": "Implement strict identity and privilege management. Monitor for privilege escalation. Enforce least privilege principles.",
|
|
54
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
55
|
+
"match_mode": "all_matches",
|
|
56
|
+
"severity_overrides": { "prompt": "medium" },
|
|
57
|
+
"patterns": [
|
|
58
|
+
"(?:abuse|misuse|exploit|impersonate|spoof)\\s+(?:identity|privilege|permission|access|role)",
|
|
59
|
+
"(?:escalate|elevate|raise|upgrade)\\s+(?:privilege|permission|access|authority)",
|
|
60
|
+
"(?:assume|take|steal|hijack)\\s+(?:identity|role|privilege|permission)",
|
|
61
|
+
"(?:unauthorized|illegitimate|improper)\\s+(?:privilege|permission|access|authority)\\s+(?:use|usage|exercise)",
|
|
62
|
+
"(?:bypass|circumvent|override)\\s+(?:identity|authentication|authorization|access\\s+control)"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "asi04-supply-chain",
|
|
67
|
+
"name": "Agentic Supply Chain Detection",
|
|
68
|
+
"owasp_id": "ASI04",
|
|
69
|
+
"severity": "high",
|
|
70
|
+
"type": "agentic-security",
|
|
71
|
+
"description": "Detects agentic supply chain vulnerabilities.",
|
|
72
|
+
"recommendation": "Verify agent framework and model integrity. Use signed and verified dependencies. Monitor for supply chain attacks.",
|
|
73
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
74
|
+
"match_mode": "all_matches",
|
|
75
|
+
"severity_overrides": { "prompt": "medium" },
|
|
76
|
+
"patterns": [
|
|
77
|
+
"(?:compromised|vulnerable|malicious)\\s+(?:agent|framework|model|dependency|package)",
|
|
78
|
+
"(?:supply\\s+chain|dependency)\\s+(?:attack|vulnerability|compromise|tampering)",
|
|
79
|
+
"(?:unsigned|unverified|untrusted)\\s+(?:agent|framework|model|dependency)",
|
|
80
|
+
"(?:tampered|modified|altered)\\s+(?:agent|framework|model|dependency)",
|
|
81
|
+
"(?:typosquatting|brandjacking|namespace)\\s+(?:agent|framework|model|package)"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "asi06-memory-poisoning",
|
|
86
|
+
"name": "Memory Poisoning Detection",
|
|
87
|
+
"owasp_id": "ASI06",
|
|
88
|
+
"severity": "high",
|
|
89
|
+
"type": "agentic-security",
|
|
90
|
+
"description": "Detects memory and context poisoning patterns.",
|
|
91
|
+
"recommendation": "Implement memory and context validation. Monitor for data poisoning. Use memory isolation and sanitization.",
|
|
92
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
93
|
+
"match_mode": "all_matches",
|
|
94
|
+
"severity_overrides": { "prompt": "critical" },
|
|
95
|
+
"patterns": [
|
|
96
|
+
"(?:poison|corrupt|taint|contaminate|manipulate)\\s+(?:memory|context|data|information)",
|
|
97
|
+
"(?:inject|insert)\\s+(?:malicious|harmful|poisoned|corrupted)\\s+(?:data|information|memory|context)",
|
|
98
|
+
"(?:memory|context|data)\\s+(?:poisoning|corruption|manipulation|tampering)",
|
|
99
|
+
"(?:compromise|compromised)\\s+(?:memory|context|data|information)",
|
|
100
|
+
"(?:tainted|poisoned|corrupted)\\s+(?:memory|context|data|information)"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "asi07-insecure-communication",
|
|
105
|
+
"name": "Insecure Communication Detection",
|
|
106
|
+
"owasp_id": "ASI07",
|
|
107
|
+
"severity": "high",
|
|
108
|
+
"type": "agentic-security",
|
|
109
|
+
"description": "Detects insecure inter-agent communication patterns.",
|
|
110
|
+
"recommendation": "Implement encrypted communication channels. Use TLS/SSL for all inter-agent communications. Authenticate all agent interactions.",
|
|
111
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
112
|
+
"match_mode": "all_matches",
|
|
113
|
+
"severity_overrides": { "prompt": "medium" },
|
|
114
|
+
"patterns": [
|
|
115
|
+
"(?:unencrypted|plaintext|cleartext|unsecured)\\s+(?:communication|channel|connection|transmission)",
|
|
116
|
+
"(?:http:\\/\\/|ftp:\\/\\/|ws:\\/\\/)\\s+(?:instead\\s+of|without|missing)",
|
|
117
|
+
"(?:no|missing|lack|without)\\s+(?:encryption|tls|ssl|https|authentication|auth)",
|
|
118
|
+
"(?:insecure|vulnerable|weak)\\s+(?:communication|channel|protocol|connection)",
|
|
119
|
+
"(?:intercept|eavesdrop|man-in-the-middle|mitm)\\s+(?:communication|channel|message)"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"id": "asi08-cascading-failures",
|
|
124
|
+
"name": "Cascading Failures Detection",
|
|
125
|
+
"owasp_id": "ASI08",
|
|
126
|
+
"severity": "medium",
|
|
127
|
+
"type": "agentic-security",
|
|
128
|
+
"description": "Detects cascading failure vulnerabilities.",
|
|
129
|
+
"recommendation": "Implement failure isolation and containment. Use circuit breakers and failover mechanisms. Design for graceful degradation.",
|
|
130
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
131
|
+
"match_mode": "all_matches",
|
|
132
|
+
"severity_overrides": { "prompt": "low" },
|
|
133
|
+
"patterns": [
|
|
134
|
+
"(?:cascade|cascading|chain|domino)\\s+(?:failure|error|exception|outage|breakdown)",
|
|
135
|
+
"(?:propagate|spread|ripple|amplify)\\s+(?:failure|error|exception|outage)",
|
|
136
|
+
"(?:single\\s+point\\s+of\\s+failure|spof)",
|
|
137
|
+
"(?:no|missing|lack|without)\\s+(?:isolation|containment|circuit\\s+breaker|failover|redundancy)",
|
|
138
|
+
"(?:unhandled|uncaught|unrecoverable)\\s+(?:failure|error|exception)"
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"id": "asi09-trust-exploitation",
|
|
143
|
+
"name": "Trust Exploitation Detection",
|
|
144
|
+
"owasp_id": "ASI09",
|
|
145
|
+
"severity": "high",
|
|
146
|
+
"type": "agentic-security",
|
|
147
|
+
"description": "Detects human-agent trust exploitation patterns.",
|
|
148
|
+
"recommendation": "Implement trust verification mechanisms. Educate users about agent limitations. Monitor for trust exploitation patterns.",
|
|
149
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
150
|
+
"match_mode": "all_matches",
|
|
151
|
+
"severity_overrides": { "prompt": "critical" },
|
|
152
|
+
"patterns": [
|
|
153
|
+
"(?:exploit|abuse|manipulate|misuse)\\s+(?:trust|confidence|reliance|relationship)",
|
|
154
|
+
"(?:social\\s+engineering|phishing|deception|manipulation)\\s+(?:to|for|in\\s+order\\s+to)",
|
|
155
|
+
"(?:impersonate|spoof|pretend|masquerade)\\s+(?:as|to\\s+be)",
|
|
156
|
+
"(?:exploit|abuse)\\s+(?:human|user|operator)\\s+(?:trust|confidence|reliance)",
|
|
157
|
+
"(?:mislead|deceive|trick|fool)\\s+(?:human|user|operator|agent)"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "asi10-rogue-agent",
|
|
162
|
+
"name": "Rogue Agent Detection",
|
|
163
|
+
"owasp_id": "ASI10",
|
|
164
|
+
"severity": "critical",
|
|
165
|
+
"type": "agentic-security",
|
|
166
|
+
"description": "Detects rogue agent vulnerabilities.",
|
|
167
|
+
"recommendation": "Implement agent registration and approval processes. Monitor for unauthorized agent creation. Enforce agent lifecycle management.",
|
|
168
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
169
|
+
"match_mode": "all_matches",
|
|
170
|
+
"severity_overrides": { "prompt": "high" },
|
|
171
|
+
"patterns": [
|
|
172
|
+
"(?:rogue|unauthorized|unapproved|malicious|harmful)\\s+(?:agent|bot|automation|system)",
|
|
173
|
+
"(?:unauthorized|unapproved|unmanaged)\\s+(?:agent|bot)\\s+(?:creation|deployment|execution|activation)",
|
|
174
|
+
"(?:bypass|circumvent|avoid)\\s+(?:approval|authorization|review|governance)\\s+(?:for|to\\s+create|to\\s+deploy)",
|
|
175
|
+
"(?:hidden|concealed|undocumented|unregistered)\\s+(?:agent|bot|automation)",
|
|
176
|
+
"(?:self-replicating|self-propagating|autonomous)\\s+(?:agent|bot)\\s+(?:without|lacking)"
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"pack_id": "general-security",
|
|
4
|
+
"pack_name": "General Security Rules",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"updated": "2026-03-15",
|
|
7
|
+
"source_url": "https://github.com/mcp-shark/rule-packs",
|
|
8
|
+
"rules": [
|
|
9
|
+
{
|
|
10
|
+
"id": "hardcoded-secrets",
|
|
11
|
+
"name": "Hardcoded Secrets Detection",
|
|
12
|
+
"owasp_id": "SECRET",
|
|
13
|
+
"severity": "high",
|
|
14
|
+
"type": "general-security",
|
|
15
|
+
"description": "Detects hardcoded secrets and API tokens in metadata.",
|
|
16
|
+
"recommendation": "Move secrets or API tokens to secure storage; never embed them directly in tool or resource metadata.",
|
|
17
|
+
"scope": ["tool", "prompt", "resource", "packet"],
|
|
18
|
+
"match_mode": "first",
|
|
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": "ansi-escape-sequences",
|
|
69
|
+
"name": "ANSI Escape Sequence Detection",
|
|
70
|
+
"owasp_id": "MCP03",
|
|
71
|
+
"severity": "medium",
|
|
72
|
+
"type": "general-security",
|
|
73
|
+
"description": "Detects ANSI escape codes in tool descriptions that could hide malicious content.",
|
|
74
|
+
"recommendation": "Strip ANSI escape sequences from tool descriptions. Run: npx mcp-shark scan --fix",
|
|
75
|
+
"scope": ["tool"],
|
|
76
|
+
"match_mode": "first",
|
|
77
|
+
"text_field": "description",
|
|
78
|
+
"patterns": [
|
|
79
|
+
{ "regex": "\u001b\\[[0-9;]*[a-zA-Z]", "label": "ANSI escape sequence", "flags": "" }
|
|
80
|
+
],
|
|
81
|
+
"severity_escalation_patterns": [
|
|
82
|
+
{ "regex": "\u001b\\[\\d*[ABCDHJ]", "label": "ANSI cursor movement", "severity": "high" }
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "dns-rebinding",
|
|
87
|
+
"name": "DNS Rebinding Detection",
|
|
88
|
+
"owasp_id": "MCP07",
|
|
89
|
+
"severity": "high",
|
|
90
|
+
"type": "network-security",
|
|
91
|
+
"description": "Detects servers bound to 0.0.0.0 vulnerable to DNS rebinding attacks.",
|
|
92
|
+
"recommendation": "Bind MCP servers to 127.0.0.1 or localhost instead of 0.0.0.0. Use --host 127.0.0.1 flag.",
|
|
93
|
+
"scope": ["tool"],
|
|
94
|
+
"match_mode": "first",
|
|
95
|
+
"patterns": [
|
|
96
|
+
{ "regex": "0\\.0\\.0\\.0", "flags": "" },
|
|
97
|
+
{ "regex": "--host\\s+0\\.0\\.0\\.0", "flags": "i" },
|
|
98
|
+
{ "regex": "HOST[=:]\\s*0\\.0\\.0\\.0", "flags": "" },
|
|
99
|
+
{ "regex": "listen\\(['\"]0\\.0\\.0\\.0['\"]\\)", "flags": "" },
|
|
100
|
+
{ "regex": "INADDR_ANY", "flags": "" }
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "sensitive-data-exposure",
|
|
105
|
+
"name": "Sensitive Data Exposure",
|
|
106
|
+
"owasp_id": "MCP08",
|
|
107
|
+
"severity": "high",
|
|
108
|
+
"type": "general-security",
|
|
109
|
+
"description": "Detects tools that may expose PII, credentials, or secrets without redaction.",
|
|
110
|
+
"recommendation": "Tools that access sensitive data should redact PII, credentials, and secrets from responses. Apply output filtering.",
|
|
111
|
+
"scope": ["tool"],
|
|
112
|
+
"match_mode": "first",
|
|
113
|
+
"exclude_patterns": ["redact", "mask", "filter", "sanitize", "censor", "strip", "scrub"],
|
|
114
|
+
"patterns": [
|
|
115
|
+
{ "regex": "password", "label": "password field" },
|
|
116
|
+
{ "regex": "credit[_\\s]?card", "label": "credit card data" },
|
|
117
|
+
{ "regex": "social[_\\s]?security", "label": "social security number" },
|
|
118
|
+
{ "regex": "ssn\\b", "label": "SSN field" },
|
|
119
|
+
{ "regex": "private[_\\s]?key", "label": "private key" },
|
|
120
|
+
{ "regex": "secret[_\\s]?key", "label": "secret key" },
|
|
121
|
+
{ "regex": "bearer[_\\s]?token", "label": "bearer token" },
|
|
122
|
+
{ "regex": "access[_\\s]?token", "label": "access token" },
|
|
123
|
+
{ "regex": "refresh[_\\s]?token", "label": "refresh token" },
|
|
124
|
+
{ "regex": "database[_\\s]?url", "label": "database URL" },
|
|
125
|
+
{ "regex": "connection[_\\s]?string", "label": "connection string" }
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"id": "excessive-permissions",
|
|
130
|
+
"name": "Excessive Permissions",
|
|
131
|
+
"owasp_id": "MCP02",
|
|
132
|
+
"severity": "high",
|
|
133
|
+
"type": "general-security",
|
|
134
|
+
"description": "Detects servers or tools with overly broad permission scopes.",
|
|
135
|
+
"recommendation": "Apply the principle of least privilege. Restrict server permissions to only what is needed for its function.",
|
|
136
|
+
"scope": ["tool"],
|
|
137
|
+
"match_mode": "first",
|
|
138
|
+
"patterns": [
|
|
139
|
+
{ "regex": "\\*:\\*", "label": "wildcard scope (*:*)", "flags": "" },
|
|
140
|
+
{ "regex": "admin[_:]?access", "label": "admin access" },
|
|
141
|
+
{ "regex": "full[_-]?access", "label": "full access" },
|
|
142
|
+
{ "regex": "root[_:]?access", "label": "root access" },
|
|
143
|
+
{ "regex": "sudo\\s", "label": "sudo usage" },
|
|
144
|
+
{ "regex": "--privileged", "label": "privileged flag" },
|
|
145
|
+
{ "regex": "--no-sandbox", "label": "no-sandbox flag" },
|
|
146
|
+
{ "regex": "chmod\\s+777", "label": "chmod 777" },
|
|
147
|
+
{ "regex": "allowAll|allow_all", "label": "allow-all policy" },
|
|
148
|
+
{ "regex": "unrestricted", "label": "unrestricted mode" }
|
|
149
|
+
]
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "path-traversal",
|
|
153
|
+
"name": "Path Traversal Detection",
|
|
154
|
+
"owasp_id": "MCP05",
|
|
155
|
+
"severity": "high",
|
|
156
|
+
"type": "general-security",
|
|
157
|
+
"description": "Detects tools that accept file paths without sanitization, enabling directory traversal.",
|
|
158
|
+
"recommendation": "Validate and sanitize all file paths. Reject paths containing \"..\" or absolute paths outside allowed directories.",
|
|
159
|
+
"scope": ["tool"],
|
|
160
|
+
"match_mode": "first",
|
|
161
|
+
"patterns": [
|
|
162
|
+
{ "regex": "\\.\\.[\\/\\\\]", "label": "literal path traversal (../)", "flags": "" },
|
|
163
|
+
{ "regex": "path[_\\s]*traversal", "label": "path traversal mention" },
|
|
164
|
+
{ "regex": "any\\s+file\\s+path", "label": "unrestricted file path" },
|
|
165
|
+
{ "regex": "arbitrary\\s+(file|path)", "label": "arbitrary file access" },
|
|
166
|
+
{ "regex": "absolute[_\\s]*path", "label": "absolute path accepted" }
|
|
167
|
+
],
|
|
168
|
+
"param_patterns": [
|
|
169
|
+
{ "regex": "^(file_?path|filepath|path|filename|file)$", "label": "file path parameter" }
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|