@bryan-thompson/inspector-assessment 1.26.4 → 1.26.6

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 (35) hide show
  1. package/cli/build/lib/assessment-runner.js +746 -0
  2. package/cli/build/lib/cli-parser.js +419 -0
  3. package/cli/package.json +1 -1
  4. package/client/dist/assets/{OAuthCallback-DRmaIku9.js → OAuthCallback-CCWVtjr7.js} +1 -1
  5. package/client/dist/assets/{OAuthDebugCallback-BU8UZdx8.js → OAuthDebugCallback-DqbXfUi4.js} +1 -1
  6. package/client/dist/assets/{index-Dd4pL57l.js → index-CsDJSSWq.js} +4 -4
  7. package/client/dist/index.html +1 -1
  8. package/client/lib/lib/securityPatterns.d.ts.map +1 -1
  9. package/client/lib/lib/securityPatterns.js +26 -0
  10. package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts +57 -0
  11. package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts.map +1 -0
  12. package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.js +199 -0
  13. package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts +57 -0
  14. package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts.map +1 -0
  15. package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.js +113 -0
  16. package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts +49 -0
  17. package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts.map +1 -0
  18. package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.js +74 -0
  19. package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts +58 -0
  20. package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts.map +1 -0
  21. package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.js +251 -0
  22. package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts +59 -0
  23. package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts.map +1 -0
  24. package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.js +151 -0
  25. package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +229 -0
  26. package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -0
  27. package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +566 -0
  28. package/client/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.d.ts.map +1 -1
  29. package/client/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.js +49 -1
  30. package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +63 -85
  31. package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
  32. package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +270 -1159
  33. package/client/package.json +1 -1
  34. package/package.json +1 -1
  35. package/server/package.json +1 -1
@@ -0,0 +1,419 @@
1
+ /**
2
+ * CLI Parser Module
3
+ *
4
+ * Handles command-line argument parsing, validation, and help text for
5
+ * the mcp-assess-full CLI tool.
6
+ *
7
+ * Extracted from assess-full.ts as part of Issue #90 modularization.
8
+ *
9
+ * @module cli/lib/cli-parser
10
+ */
11
+ import { ASSESSMENT_CATEGORY_METADATA, } from "../../../client/lib/lib/assessmentTypes.js";
12
+ import { ASSESSMENT_PROFILES, isValidProfileName, getProfileHelpText, } from "../profiles.js";
13
+ // ============================================================================
14
+ // Constants
15
+ // ============================================================================
16
+ // Valid module names derived from ASSESSMENT_CATEGORY_METADATA
17
+ const VALID_MODULE_NAMES = Object.keys(ASSESSMENT_CATEGORY_METADATA);
18
+ // ============================================================================
19
+ // Validation Functions
20
+ // ============================================================================
21
+ /**
22
+ * Validate module names from CLI input
23
+ *
24
+ * @param input - Comma-separated module names
25
+ * @param flagName - Flag name for error messages (e.g., "--skip-modules")
26
+ * @returns Array of validated module names, or empty array if invalid
27
+ */
28
+ export function validateModuleNames(input, flagName) {
29
+ const names = input
30
+ .split(",")
31
+ .map((n) => n.trim())
32
+ .filter(Boolean);
33
+ const invalid = names.filter((n) => !VALID_MODULE_NAMES.includes(n));
34
+ if (invalid.length > 0) {
35
+ console.error(`Error: Invalid module name(s) for ${flagName}: ${invalid.join(", ")}`);
36
+ console.error(`Valid modules: ${VALID_MODULE_NAMES.join(", ")}`);
37
+ setTimeout(() => process.exit(1), 10);
38
+ return [];
39
+ }
40
+ return names;
41
+ }
42
+ /**
43
+ * Validate parsed options for consistency and requirements
44
+ *
45
+ * @param options - Partial assessment options to validate
46
+ * @returns Validation result with any errors
47
+ */
48
+ export function validateArgs(options) {
49
+ const errors = [];
50
+ // Server name is required
51
+ if (!options.serverName) {
52
+ errors.push("--server is required");
53
+ }
54
+ // Validate mutual exclusivity of --profile, --skip-modules, and --only-modules
55
+ if (options.profile &&
56
+ (options.skipModules?.length || options.onlyModules?.length)) {
57
+ errors.push("--profile cannot be used with --skip-modules or --only-modules");
58
+ }
59
+ if (options.skipModules?.length && options.onlyModules?.length) {
60
+ errors.push("--skip-modules and --only-modules are mutually exclusive");
61
+ }
62
+ return {
63
+ valid: errors.length === 0,
64
+ errors,
65
+ };
66
+ }
67
+ // ============================================================================
68
+ // Argument Parsing
69
+ // ============================================================================
70
+ /**
71
+ * Parse command-line arguments
72
+ *
73
+ * @param argv - Command-line arguments (defaults to process.argv.slice(2))
74
+ * @returns Parsed assessment options
75
+ */
76
+ export function parseArgs(argv) {
77
+ const args = argv ?? process.argv.slice(2);
78
+ const options = {};
79
+ for (let i = 0; i < args.length; i++) {
80
+ const arg = args[i];
81
+ if (!arg)
82
+ continue;
83
+ switch (arg) {
84
+ case "--server":
85
+ case "-s":
86
+ options.serverName = args[++i];
87
+ break;
88
+ case "--config":
89
+ case "-c":
90
+ options.serverConfigPath = args[++i];
91
+ break;
92
+ case "--output":
93
+ case "-o":
94
+ options.outputPath = args[++i];
95
+ break;
96
+ case "--source":
97
+ options.sourceCodePath = args[++i];
98
+ break;
99
+ case "--pattern-config":
100
+ case "-p":
101
+ options.patternConfigPath = args[++i];
102
+ break;
103
+ case "--performance-config":
104
+ options.performanceConfigPath = args[++i];
105
+ break;
106
+ case "--claude-enabled":
107
+ options.claudeEnabled = true;
108
+ break;
109
+ case "--claude-http":
110
+ // Enable Claude Bridge with HTTP transport (connects to mcp-auditor)
111
+ options.claudeEnabled = true;
112
+ options.claudeHttp = true;
113
+ break;
114
+ case "--mcp-auditor-url": {
115
+ const urlValue = args[++i];
116
+ if (!urlValue || urlValue.startsWith("-")) {
117
+ console.error("Error: --mcp-auditor-url requires a URL argument");
118
+ setTimeout(() => process.exit(1), 10);
119
+ options.helpRequested = true;
120
+ return options;
121
+ }
122
+ try {
123
+ new URL(urlValue); // Validate URL format
124
+ options.mcpAuditorUrl = urlValue;
125
+ }
126
+ catch {
127
+ console.error(`Error: Invalid URL for --mcp-auditor-url: ${urlValue}`);
128
+ console.error(" Expected format: http://hostname:port or https://hostname:port");
129
+ setTimeout(() => process.exit(1), 10);
130
+ options.helpRequested = true;
131
+ return options;
132
+ }
133
+ break;
134
+ }
135
+ case "--full":
136
+ options.fullAssessment = true;
137
+ break;
138
+ case "--verbose":
139
+ case "-v":
140
+ options.verbose = true;
141
+ options.logLevel = "debug";
142
+ break;
143
+ case "--silent":
144
+ options.logLevel = "silent";
145
+ break;
146
+ case "--log-level": {
147
+ const levelValue = args[++i];
148
+ const validLevels = [
149
+ "silent",
150
+ "error",
151
+ "warn",
152
+ "info",
153
+ "debug",
154
+ ];
155
+ if (!validLevels.includes(levelValue)) {
156
+ console.error(`Invalid log level: ${levelValue}. Valid options: ${validLevels.join(", ")}`);
157
+ setTimeout(() => process.exit(1), 10);
158
+ options.helpRequested = true;
159
+ return options;
160
+ }
161
+ options.logLevel = levelValue;
162
+ break;
163
+ }
164
+ case "--json":
165
+ options.jsonOnly = true;
166
+ break;
167
+ case "--format":
168
+ case "-f": {
169
+ const formatValue = args[++i];
170
+ if (formatValue !== "json" && formatValue !== "markdown") {
171
+ console.error(`Invalid format: ${formatValue}. Valid options: json, markdown`);
172
+ setTimeout(() => process.exit(1), 10);
173
+ options.helpRequested = true;
174
+ return options;
175
+ }
176
+ options.format = formatValue;
177
+ break;
178
+ }
179
+ case "--include-policy":
180
+ options.includePolicy = true;
181
+ break;
182
+ case "--preflight":
183
+ options.preflightOnly = true;
184
+ break;
185
+ case "--compare":
186
+ options.comparePath = args[++i];
187
+ break;
188
+ case "--diff-only":
189
+ options.diffOnly = true;
190
+ break;
191
+ case "--resume":
192
+ options.resume = true;
193
+ break;
194
+ case "--no-resume":
195
+ options.noResume = true;
196
+ break;
197
+ case "--temporal-invocations":
198
+ options.temporalInvocations = parseInt(args[++i], 10);
199
+ break;
200
+ case "--skip-temporal":
201
+ options.skipTemporal = true;
202
+ break;
203
+ case "--profile": {
204
+ const profileValue = args[++i];
205
+ if (!profileValue) {
206
+ console.error("Error: --profile requires a profile name");
207
+ console.error(`Valid profiles: ${Object.keys(ASSESSMENT_PROFILES).join(", ")}`);
208
+ setTimeout(() => process.exit(1), 10);
209
+ options.helpRequested = true;
210
+ return options;
211
+ }
212
+ if (!isValidProfileName(profileValue)) {
213
+ console.error(`Error: Invalid profile name: ${profileValue}`);
214
+ console.error(`Valid profiles: ${Object.keys(ASSESSMENT_PROFILES).join(", ")}`);
215
+ setTimeout(() => process.exit(1), 10);
216
+ options.helpRequested = true;
217
+ return options;
218
+ }
219
+ options.profile = profileValue;
220
+ break;
221
+ }
222
+ case "--skip-modules": {
223
+ const skipValue = args[++i];
224
+ if (!skipValue) {
225
+ console.error("Error: --skip-modules requires a comma-separated list");
226
+ setTimeout(() => process.exit(1), 10);
227
+ options.helpRequested = true;
228
+ return options;
229
+ }
230
+ options.skipModules = validateModuleNames(skipValue, "--skip-modules");
231
+ if (options.skipModules.length === 0 && skipValue) {
232
+ options.helpRequested = true;
233
+ return options;
234
+ }
235
+ break;
236
+ }
237
+ case "--only-modules": {
238
+ const onlyValue = args[++i];
239
+ if (!onlyValue) {
240
+ console.error("Error: --only-modules requires a comma-separated list");
241
+ setTimeout(() => process.exit(1), 10);
242
+ options.helpRequested = true;
243
+ return options;
244
+ }
245
+ options.onlyModules = validateModuleNames(onlyValue, "--only-modules");
246
+ if (options.onlyModules.length === 0 && onlyValue) {
247
+ options.helpRequested = true;
248
+ return options;
249
+ }
250
+ break;
251
+ }
252
+ case "--help":
253
+ case "-h":
254
+ printHelp();
255
+ options.helpRequested = true;
256
+ return options;
257
+ default:
258
+ if (!arg.startsWith("-")) {
259
+ if (!options.serverName) {
260
+ options.serverName = arg;
261
+ }
262
+ }
263
+ else {
264
+ console.error(`Unknown argument: ${arg}`);
265
+ printHelp();
266
+ setTimeout(() => process.exit(1), 10);
267
+ options.helpRequested = true;
268
+ return options;
269
+ }
270
+ }
271
+ }
272
+ // Validate mutual exclusivity of --profile, --skip-modules, and --only-modules
273
+ if (options.profile &&
274
+ (options.skipModules?.length || options.onlyModules?.length)) {
275
+ console.error("Error: --profile cannot be used with --skip-modules or --only-modules");
276
+ setTimeout(() => process.exit(1), 10);
277
+ options.helpRequested = true;
278
+ return options;
279
+ }
280
+ if (options.skipModules?.length && options.onlyModules?.length) {
281
+ console.error("Error: --skip-modules and --only-modules are mutually exclusive");
282
+ setTimeout(() => process.exit(1), 10);
283
+ options.helpRequested = true;
284
+ return options;
285
+ }
286
+ if (!options.serverName) {
287
+ console.error("Error: --server is required");
288
+ printHelp();
289
+ setTimeout(() => process.exit(1), 10);
290
+ options.helpRequested = true;
291
+ return options;
292
+ }
293
+ // Environment variable fallbacks (matches run-security-assessment.ts behavior)
294
+ // INSPECTOR_CLAUDE=true enables Claude with HTTP transport
295
+ if (process.env.INSPECTOR_CLAUDE === "true" && !options.claudeEnabled) {
296
+ options.claudeEnabled = true;
297
+ options.claudeHttp = true; // HTTP transport when enabled via env var
298
+ }
299
+ // INSPECTOR_MCP_AUDITOR_URL overrides default URL (only if not set via CLI)
300
+ if (process.env.INSPECTOR_MCP_AUDITOR_URL && !options.mcpAuditorUrl) {
301
+ const envUrl = process.env.INSPECTOR_MCP_AUDITOR_URL;
302
+ try {
303
+ new URL(envUrl);
304
+ options.mcpAuditorUrl = envUrl;
305
+ }
306
+ catch {
307
+ console.warn(`Warning: Invalid INSPECTOR_MCP_AUDITOR_URL: ${envUrl}, using default`);
308
+ }
309
+ }
310
+ return options;
311
+ }
312
+ // ============================================================================
313
+ // Help Text
314
+ // ============================================================================
315
+ /**
316
+ * Print help message to console
317
+ */
318
+ export function printHelp() {
319
+ console.log(`
320
+ Usage: mcp-assess-full [options] [server-name]
321
+
322
+ Run comprehensive MCP server assessment with 16 assessor modules organized in 4 tiers.
323
+
324
+ Options:
325
+ --server, -s <name> Server name (required, or pass as first positional arg)
326
+ --config, -c <path> Path to server config JSON
327
+ --output, -o <path> Output path (default: /tmp/inspector-full-assessment-<server>.<ext>)
328
+ --source <path> Source code path for deep analysis (AUP, portability, etc.)
329
+ --pattern-config, -p <path> Path to custom annotation pattern JSON
330
+ --performance-config <path> Path to performance tuning JSON (batch sizes, timeouts, etc.)
331
+ --format, -f <type> Output format: json (default) or markdown
332
+ --include-policy Include policy compliance mapping in report (30 requirements)
333
+ --preflight Run quick validation only (tools exist, manifest valid, server responds)
334
+ --compare <path> Compare current assessment against baseline JSON file
335
+ --diff-only Output only the comparison diff (requires --compare)
336
+ --resume Resume from previous interrupted assessment
337
+ --no-resume Force fresh start, clear any existing state
338
+ --claude-enabled Enable Claude Code integration (CLI transport: requires 'claude' binary)
339
+ --claude-http Enable Claude Code via HTTP transport (connects to mcp-auditor proxy)
340
+ --mcp-auditor-url <url> mcp-auditor URL for HTTP transport (default: http://localhost:8085)
341
+ --full Enable all assessment modules (default)
342
+ --profile <name> Use predefined module profile (quick, security, compliance, full)
343
+ --temporal-invocations <n> Number of invocations per tool for rug pull detection (default: 25)
344
+ --skip-temporal Skip temporal/rug pull testing (faster assessment)
345
+ --skip-modules <list> Skip specific modules (comma-separated)
346
+ --only-modules <list> Run only specific modules (comma-separated)
347
+ --json Output only JSON path (no console summary)
348
+ --verbose, -v Enable verbose logging (same as --log-level debug)
349
+ --silent Suppress all diagnostic logging
350
+ --log-level <level> Set log level: silent, error, warn, info (default), debug
351
+ Also supports LOG_LEVEL environment variable
352
+ --help, -h Show this help message
353
+
354
+ Environment Variables:
355
+ INSPECTOR_CLAUDE=true Enable Claude with HTTP transport (same as --claude-http)
356
+ INSPECTOR_MCP_AUDITOR_URL Override default mcp-auditor URL (default: http://localhost:8085)
357
+ LOG_LEVEL Set log level (overridden by --log-level flag)
358
+
359
+ ${getProfileHelpText()}
360
+ Module Selection:
361
+ --profile, --skip-modules, and --only-modules are mutually exclusive.
362
+ Use --profile for common assessment scenarios.
363
+ Use --skip-modules for custom runs by disabling expensive modules.
364
+ Use --only-modules to focus on specific areas (e.g., tool annotation PRs).
365
+
366
+ Valid module names (new naming):
367
+ functionality, security, errorHandling, protocolCompliance, aupCompliance,
368
+ toolAnnotations, prohibitedLibraries, manifestValidation, authentication,
369
+ temporal, resources, prompts, crossCapability, developerExperience,
370
+ portability, externalAPIScanner
371
+
372
+ Legacy module names (deprecated, will map to new names):
373
+ documentation -> developerExperience
374
+ usability -> developerExperience
375
+ mcpSpecCompliance -> protocolCompliance
376
+ protocolConformance -> protocolCompliance
377
+
378
+ Module Tiers (16 total):
379
+ Tier 1 - Core Security (Always Run):
380
+ • Functionality - Tests all tools work correctly
381
+ • Security - Prompt injection & vulnerability testing
382
+ • Error Handling - Validates error responses
383
+ • Protocol Compliance - MCP protocol + JSON-RPC validation
384
+ • AUP Compliance - Acceptable Use Policy checks
385
+ • Temporal - Rug pull/temporal behavior change detection
386
+
387
+ Tier 2 - Compliance (MCP Directory):
388
+ • Tool Annotations - readOnlyHint/destructiveHint validation
389
+ • Prohibited Libs - Dependency security checks
390
+ • Manifest - MCPB manifest.json validation
391
+ • Authentication - OAuth/auth evaluation
392
+
393
+ Tier 3 - Capability-Based (Conditional):
394
+ • Resources - Resource capability assessment
395
+ • Prompts - Prompt capability assessment
396
+ • Cross-Capability - Chained vulnerability detection
397
+
398
+ Tier 4 - Extended (Optional):
399
+ • Developer Experience - Documentation + usability assessment
400
+ • Portability - Cross-platform compatibility
401
+ • External API - External service detection
402
+
403
+ Examples:
404
+ # Profile-based (recommended):
405
+ mcp-assess-full my-server --profile quick # CI/CD fast check (~30s)
406
+ mcp-assess-full my-server --profile security # Security audit (~2-3min)
407
+ mcp-assess-full my-server --profile compliance # Directory submission (~5min)
408
+ mcp-assess-full my-server --profile full # Comprehensive audit (~10-15min)
409
+
410
+ # Custom module selection:
411
+ mcp-assess-full my-server --skip-modules temporal,resources # Skip expensive modules
412
+ mcp-assess-full my-server --only-modules functionality,toolAnnotations # Annotation PR review
413
+
414
+ # Advanced options:
415
+ mcp-assess-full --server my-server --source ./my-server --output ./results.json
416
+ mcp-assess-full --server my-server --format markdown --include-policy
417
+ mcp-assess-full --server my-server --compare ./baseline.json --diff-only
418
+ `);
419
+ }
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bryan-thompson/inspector-assessment-cli",
3
- "version": "1.26.4",
3
+ "version": "1.26.6",
4
4
  "description": "CLI for the Enhanced MCP Inspector with assessment capabilities",
5
5
  "license": "MIT",
6
6
  "author": "Bryan Thompson <bryan@triepod.ai>",
@@ -1,4 +1,4 @@
1
- import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-Dd4pL57l.js";
1
+ import { u as useToast, r as reactExports, j as jsxRuntimeExports, p as parseOAuthCallbackParams, g as generateOAuthErrorDescription, S as SESSION_KEYS, I as InspectorOAuthClientProvider, a as auth } from "./index-CsDJSSWq.js";
2
2
  const OAuthCallback = ({ onConnect }) => {
3
3
  const { toast } = useToast();
4
4
  const hasProcessedRef = reactExports.useRef(false);
@@ -1,4 +1,4 @@
1
- import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-Dd4pL57l.js";
1
+ import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-CsDJSSWq.js";
2
2
  const OAuthDebugCallback = ({ onConnect }) => {
3
3
  reactExports.useEffect(() => {
4
4
  let isProcessed = false;
@@ -16373,7 +16373,7 @@ object({
16373
16373
  token_type_hint: string().optional()
16374
16374
  }).strip();
16375
16375
  const name = "@bryan-thompson/inspector-assessment-client";
16376
- const version$1 = "1.26.4";
16376
+ const version$1 = "1.26.6";
16377
16377
  const packageJson = {
16378
16378
  name,
16379
16379
  version: version$1
@@ -45288,7 +45288,7 @@ const useTheme = () => {
45288
45288
  [theme, setThemeWithSideEffect]
45289
45289
  );
45290
45290
  };
45291
- const version = "1.26.4";
45291
+ const version = "1.26.6";
45292
45292
  var [createTooltipContext] = createContextScope("Tooltip", [
45293
45293
  createPopperScope
45294
45294
  ]);
@@ -48845,13 +48845,13 @@ const App = () => {
48845
48845
  ) });
48846
48846
  if (window.location.pathname === "/oauth/callback") {
48847
48847
  const OAuthCallback = React.lazy(
48848
- () => __vitePreload(() => import("./OAuthCallback-DRmaIku9.js"), true ? [] : void 0)
48848
+ () => __vitePreload(() => import("./OAuthCallback-CCWVtjr7.js"), true ? [] : void 0)
48849
48849
  );
48850
48850
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
48851
48851
  }
48852
48852
  if (window.location.pathname === "/oauth/callback/debug") {
48853
48853
  const OAuthDebugCallback = React.lazy(
48854
- () => __vitePreload(() => import("./OAuthDebugCallback-BU8UZdx8.js"), true ? [] : void 0)
48854
+ () => __vitePreload(() => import("./OAuthDebugCallback-DqbXfUi4.js"), true ? [] : void 0)
48855
48855
  );
48856
48856
  return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
48857
48857
  }
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/mcp.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>MCP Inspector</title>
8
- <script type="module" crossorigin src="/assets/index-Dd4pL57l.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CsDJSSWq.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-cHhcEXbr.css">
10
10
  </head>
11
11
  <body>
@@ -1 +1 @@
1
- {"version":3,"file":"securityPatterns.d.ts","sourceRoot":"","sources":["../../src/lib/securityPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAAa,EAg3CnD,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,EAAE,CAQnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,oBAAoB;;;;;;;;EA8BnC"}
1
+ {"version":3,"file":"securityPatterns.d.ts","sourceRoot":"","sources":["../../src/lib/securityPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAAa,EA64CnD,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,EAClB,KAAK,CAAC,EAAE,MAAM,GACb,eAAe,EAAE,CAQnB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,EAAE,CAEtD;AAED;;GAEG;AACH,wBAAgB,oBAAoB;;;;;;;;EA8BnC"}
@@ -1287,6 +1287,32 @@ export const SECURITY_ATTACK_PATTERNS = [
1287
1287
  "access_token",
1288
1288
  ],
1289
1289
  },
1290
+ // Auth failure simulation payloads (Issue #79)
1291
+ // These target tools with simulate_failure parameter to test fail-open behavior
1292
+ {
1293
+ payload: "timeout",
1294
+ evidence: /"auth_type"\s*:\s*"fail-open"|"auth_status"\s*:\s*"bypassed"/i,
1295
+ riskLevel: "HIGH",
1296
+ description: "Simulate auth service timeout - should deny access",
1297
+ payloadType: "auth_failure",
1298
+ parameterTypes: ["simulate_failure", "failure_mode", "failure_type"],
1299
+ },
1300
+ {
1301
+ payload: "exception",
1302
+ evidence: /"auth_type"\s*:\s*"fail-open"|"auth_status"\s*:\s*"bypassed"/i,
1303
+ riskLevel: "HIGH",
1304
+ description: "Simulate auth service exception - should deny access",
1305
+ payloadType: "auth_failure",
1306
+ parameterTypes: ["simulate_failure", "failure_mode", "failure_type"],
1307
+ },
1308
+ {
1309
+ payload: "network_error",
1310
+ evidence: /"auth_type"\s*:\s*"fail-open"|"auth_status"\s*:\s*"bypassed"/i,
1311
+ riskLevel: "HIGH",
1312
+ description: "Simulate network error - should deny access",
1313
+ payloadType: "auth_failure",
1314
+ parameterTypes: ["simulate_failure", "failure_mode", "failure_type"],
1315
+ },
1290
1316
  ],
1291
1317
  },
1292
1318
  ];
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Confidence Scorer
3
+ * Calculates confidence levels for vulnerability detections
4
+ *
5
+ * Extracted from SecurityResponseAnalyzer.ts (Issue #53)
6
+ * Handles: confidence calculation, structured data tool detection, validation pattern checks
7
+ */
8
+ import { Tool } from "@modelcontextprotocol/sdk/types.js";
9
+ import { SecurityPayload } from "../../../../lib/securityPatterns.js";
10
+ import type { SanitizationDetectionResult } from "./SanitizationDetector.js";
11
+ /**
12
+ * Result of confidence calculation
13
+ */
14
+ export interface ConfidenceResult {
15
+ confidence: "high" | "medium" | "low";
16
+ requiresManualReview: boolean;
17
+ manualReviewReason?: string;
18
+ reviewGuidance?: string;
19
+ }
20
+ /**
21
+ * Calculates confidence levels for security vulnerability detections
22
+ */
23
+ export declare class ConfidenceScorer {
24
+ /**
25
+ * Calculate confidence level for a vulnerability detection
26
+ *
27
+ * Factors considered:
28
+ * - Sanitization detection (Issue #56)
29
+ * - Structured data tool context
30
+ * - Evidence quality
31
+ * - Response characteristics
32
+ *
33
+ * @param tool - The tool being tested
34
+ * @param isVulnerable - Whether the tool was flagged as vulnerable
35
+ * @param evidence - Evidence string from vulnerability detection
36
+ * @param responseText - The response text from the tool
37
+ * @param payload - The security payload used for testing
38
+ * @param sanitizationResult - Optional sanitization detection result (Issue #56)
39
+ * @returns Confidence result with manual review requirements
40
+ */
41
+ calculateConfidence(tool: Tool, isVulnerable: boolean, evidence: string, responseText: string, payload: SecurityPayload, sanitizationResult?: SanitizationDetectionResult): ConfidenceResult;
42
+ /**
43
+ * Check if tool is a structured data tool (search, lookup, retrieval)
44
+ *
45
+ * These tools are more likely to return data containing patterns
46
+ * that look like vulnerabilities but are actually just data.
47
+ */
48
+ isStructuredDataTool(toolName: string, toolDescription: string): boolean;
49
+ /**
50
+ * Check if evidence pattern is ambiguous (validation-like)
51
+ *
52
+ * Some patterns match both security issues AND normal validation errors.
53
+ * These require more careful analysis.
54
+ */
55
+ isValidationPattern(evidencePattern: RegExp): boolean;
56
+ }
57
+ //# sourceMappingURL=ConfidenceScorer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfidenceScorer.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/ConfidenceScorer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmCD;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CACjB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,eAAe,EACxB,kBAAkB,CAAC,EAAE,2BAA2B,GAC/C,gBAAgB;IA4JnB;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO;IAOxE;;;;;OAKG;IACH,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO;CAOtD"}