@bryan-thompson/inspector-assessment 1.26.5 → 1.26.7
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/cli/build/__tests__/assessment-runner/assessment-executor.test.js +248 -0
- package/cli/build/__tests__/assessment-runner/config-builder.test.js +289 -0
- package/cli/build/__tests__/assessment-runner/index.test.js +41 -0
- package/cli/build/__tests__/assessment-runner/server-config.test.js +249 -0
- package/cli/build/__tests__/assessment-runner/server-connection.test.js +221 -0
- package/cli/build/__tests__/assessment-runner/source-loader.test.js +341 -0
- package/cli/build/__tests__/assessment-runner/tool-wrapper.test.js +114 -0
- package/cli/build/__tests__/assessment-runner-facade.test.js +118 -0
- package/cli/build/assess-full.js +26 -1254
- package/cli/build/lib/assessment-runner/assessment-executor.js +323 -0
- package/cli/build/lib/assessment-runner/config-builder.js +127 -0
- package/cli/build/lib/assessment-runner/index.js +20 -0
- package/cli/build/lib/assessment-runner/server-config.js +78 -0
- package/cli/build/lib/assessment-runner/server-connection.js +80 -0
- package/cli/build/lib/assessment-runner/source-loader.js +139 -0
- package/cli/build/lib/assessment-runner/tool-wrapper.js +40 -0
- package/cli/build/lib/assessment-runner/types.js +8 -0
- package/cli/build/lib/assessment-runner.js +12 -0
- package/cli/build/lib/cli-parser.js +419 -0
- package/cli/build/lib/comparison-handler.js +84 -0
- package/cli/build/lib/result-output.js +154 -0
- package/cli/package.json +1 -1
- package/client/dist/assets/{OAuthCallback-DpdInvWI.js → OAuthCallback-kF1MLuwg.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-D1ImpKK5.js → OAuthDebugCallback-Nv-8u0GR.js} +1 -1
- package/client/dist/assets/{index-umcoGmYw.js → index-CCiX5wkF.js} +4 -4
- package/client/dist/index.html +1 -1
- package/client/lib/lib/assessment/configTypes.d.ts +2 -0
- package/client/lib/lib/assessment/configTypes.d.ts.map +1 -1
- package/client/lib/lib/securityPatterns.d.ts +4 -2
- package/client/lib/lib/securityPatterns.d.ts.map +1 -1
- package/client/lib/lib/securityPatterns.js +146 -2
- package/client/lib/services/assessment/modules/AUPComplianceAssessor.js +9 -9
- package/client/lib/services/assessment/modules/AuthenticationAssessor.js +4 -4
- package/client/lib/services/assessment/modules/BaseAssessor.d.ts +0 -14
- package/client/lib/services/assessment/modules/BaseAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/BaseAssessor.js +1 -33
- package/client/lib/services/assessment/modules/CrossCapabilitySecurityAssessor.js +1 -1
- package/client/lib/services/assessment/modules/DeveloperExperienceAssessor.js +1 -1
- package/client/lib/services/assessment/modules/DocumentationAssessor.js +2 -2
- package/client/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ErrorHandlingAssessor.js +8 -8
- package/client/lib/services/assessment/modules/ExternalAPIScannerAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ExternalAPIScannerAssessor.js +3 -3
- package/client/lib/services/assessment/modules/FunctionalityAssessor.js +9 -9
- package/client/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/MCPSpecComplianceAssessor.js +12 -12
- package/client/lib/services/assessment/modules/ManifestValidationAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ManifestValidationAssessor.js +9 -5
- package/client/lib/services/assessment/modules/PortabilityAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/PortabilityAssessor.js +3 -3
- package/client/lib/services/assessment/modules/ProhibitedLibrariesAssessor.js +4 -4
- package/client/lib/services/assessment/modules/PromptAssessor.js +2 -2
- package/client/lib/services/assessment/modules/ProtocolComplianceAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ProtocolComplianceAssessor.js +7 -7
- package/client/lib/services/assessment/modules/ProtocolConformanceAssessor.js +1 -1
- package/client/lib/services/assessment/modules/ResourceAssessor.js +1 -1
- package/client/lib/services/assessment/modules/SecurityAssessor.d.ts +25 -2
- package/client/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/SecurityAssessor.js +149 -17
- package/client/lib/services/assessment/modules/TemporalAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/TemporalAssessor.js +10 -10
- package/client/lib/services/assessment/modules/ToolAnnotationAssessor.js +9 -9
- package/client/lib/services/assessment/modules/UsabilityAssessor.js +1 -1
- package/client/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.js +37 -0
- package/client/lib/services/assessment/modules/index.d.ts +3 -0
- package/client/lib/services/assessment/modules/index.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/ChainExecutionTester.d.ts +104 -0
- package/client/lib/services/assessment/modules/securityTests/ChainExecutionTester.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/ChainExecutionTester.js +257 -0
- package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts +57 -0
- package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/ConfidenceScorer.js +199 -0
- package/client/lib/services/assessment/modules/securityTests/CrossToolStateTester.d.ts +91 -0
- package/client/lib/services/assessment/modules/securityTests/CrossToolStateTester.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/CrossToolStateTester.js +225 -0
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts +57 -0
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.js +113 -0
- package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts +49 -0
- package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.js +74 -0
- package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts +58 -0
- package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/MathAnalyzer.js +251 -0
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts +59 -0
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.js +151 -0
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +349 -0
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +904 -0
- package/client/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.js +49 -24
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +122 -85
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +443 -1176
- package/client/lib/services/assessment/modules/securityTests/index.d.ts +3 -1
- package/client/lib/services/assessment/modules/securityTests/index.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/index.js +2 -0
- package/client/package.json +1 -1
- package/package.json +9 -1
- package/server/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparison Handler Module
|
|
3
|
+
*
|
|
4
|
+
* Handles assessment comparison/diff logic for comparing
|
|
5
|
+
* current results against a baseline.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/lib/comparison-handler
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import { compareAssessments, } from "../../../client/lib/lib/assessmentDiffer.js";
|
|
11
|
+
import { formatDiffAsMarkdown } from "../../../client/lib/lib/reportFormatters/DiffReportFormatter.js";
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Comparison Functions
|
|
14
|
+
// ============================================================================
|
|
15
|
+
/**
|
|
16
|
+
* Handle comparison mode - compare current results against a baseline.
|
|
17
|
+
*
|
|
18
|
+
* @param results - Current assessment results
|
|
19
|
+
* @param options - CLI options including comparePath and diffOnly
|
|
20
|
+
* @returns ComparisonResult if comparison was performed, null if no comparison
|
|
21
|
+
*/
|
|
22
|
+
export function handleComparison(results, options) {
|
|
23
|
+
if (!options.comparePath) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
if (!fs.existsSync(options.comparePath)) {
|
|
27
|
+
console.error(`Error: Baseline file not found: ${options.comparePath}`);
|
|
28
|
+
// Return null to indicate comparison failed - caller handles null returns
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const baselineData = JSON.parse(fs.readFileSync(options.comparePath, "utf-8"));
|
|
32
|
+
// Validate baseline has expected structure
|
|
33
|
+
if (!baselineData.functionality || !baselineData.security) {
|
|
34
|
+
console.warn("Warning: Baseline file may be incomplete (missing functionality or security)");
|
|
35
|
+
}
|
|
36
|
+
const baseline = baselineData;
|
|
37
|
+
const diff = compareAssessments(baseline, results);
|
|
38
|
+
// Handle diff-only mode
|
|
39
|
+
if (options.diffOnly) {
|
|
40
|
+
let diffPath;
|
|
41
|
+
if (options.format === "markdown") {
|
|
42
|
+
diffPath =
|
|
43
|
+
options.outputPath || `/tmp/inspector-diff-${options.serverName}.md`;
|
|
44
|
+
fs.writeFileSync(diffPath, formatDiffAsMarkdown(diff));
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
diffPath =
|
|
48
|
+
options.outputPath || `/tmp/inspector-diff-${options.serverName}.json`;
|
|
49
|
+
fs.writeFileSync(diffPath, JSON.stringify(diff, null, 2));
|
|
50
|
+
}
|
|
51
|
+
const exitCode = diff.summary.overallChange === "regressed" ? 1 : 0;
|
|
52
|
+
return { diff, exitCode, diffOutputPath: diffPath };
|
|
53
|
+
}
|
|
54
|
+
// Return comparison result for normal mode
|
|
55
|
+
const exitCode = diff.summary.overallChange === "regressed" ? 1 : 0;
|
|
56
|
+
return { diff, exitCode };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Display comparison summary to console.
|
|
60
|
+
*
|
|
61
|
+
* @param diff - Assessment diff to display
|
|
62
|
+
*/
|
|
63
|
+
export function displayComparisonSummary(diff) {
|
|
64
|
+
console.log("\n" + "=".repeat(70));
|
|
65
|
+
console.log("VERSION COMPARISON");
|
|
66
|
+
console.log("=".repeat(70));
|
|
67
|
+
console.log(`Baseline: ${diff.baseline.version || "N/A"} (${diff.baseline.date})`);
|
|
68
|
+
console.log(`Current: ${diff.current.version || "N/A"} (${diff.current.date})`);
|
|
69
|
+
console.log(`Overall Change: ${diff.summary.overallChange.toUpperCase()}`);
|
|
70
|
+
console.log(`Modules Improved: ${diff.summary.modulesImproved}`);
|
|
71
|
+
console.log(`Modules Regressed: ${diff.summary.modulesRegressed}`);
|
|
72
|
+
if (diff.securityDelta.newVulnerabilities.length > 0) {
|
|
73
|
+
console.log(`\n⚠️ NEW VULNERABILITIES: ${diff.securityDelta.newVulnerabilities.length}`);
|
|
74
|
+
}
|
|
75
|
+
if (diff.securityDelta.fixedVulnerabilities.length > 0) {
|
|
76
|
+
console.log(`✅ FIXED VULNERABILITIES: ${diff.securityDelta.fixedVulnerabilities.length}`);
|
|
77
|
+
}
|
|
78
|
+
if (diff.functionalityDelta.newBrokenTools.length > 0) {
|
|
79
|
+
console.log(`❌ NEW BROKEN TOOLS: ${diff.functionalityDelta.newBrokenTools.length}`);
|
|
80
|
+
}
|
|
81
|
+
if (diff.functionalityDelta.fixedTools.length > 0) {
|
|
82
|
+
console.log(`✅ FIXED TOOLS: ${diff.functionalityDelta.fixedTools.length}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result Output Module
|
|
3
|
+
*
|
|
4
|
+
* Handles saving assessment results to files and displaying
|
|
5
|
+
* summaries to the console.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/lib/result-output
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "fs";
|
|
10
|
+
import { ASSESSMENT_CATEGORY_METADATA, } from "../../../client/lib/lib/assessmentTypes.js";
|
|
11
|
+
import { createFormatter } from "../../../client/lib/lib/reportFormatters/index.js";
|
|
12
|
+
import { generatePolicyComplianceReport } from "../../../client/lib/services/assessment/PolicyComplianceGenerator.js";
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Result Output
|
|
15
|
+
// ============================================================================
|
|
16
|
+
/**
|
|
17
|
+
* Save results to file with appropriate format
|
|
18
|
+
*/
|
|
19
|
+
export function saveResults(serverName, results, options) {
|
|
20
|
+
const format = options.format || "json";
|
|
21
|
+
// Generate policy compliance report if requested
|
|
22
|
+
const policyReport = options.includePolicy
|
|
23
|
+
? generatePolicyComplianceReport(results, serverName)
|
|
24
|
+
: undefined;
|
|
25
|
+
// Create formatter with options
|
|
26
|
+
const formatter = createFormatter({
|
|
27
|
+
format,
|
|
28
|
+
includePolicyMapping: options.includePolicy,
|
|
29
|
+
policyReport,
|
|
30
|
+
serverName,
|
|
31
|
+
includeDetails: true,
|
|
32
|
+
prettyPrint: true,
|
|
33
|
+
});
|
|
34
|
+
const fileExtension = formatter.getFileExtension();
|
|
35
|
+
const defaultPath = `/tmp/inspector-full-assessment-${serverName}${fileExtension}`;
|
|
36
|
+
const finalPath = options.outputPath || defaultPath;
|
|
37
|
+
// For JSON format, add metadata wrapper
|
|
38
|
+
if (format === "json") {
|
|
39
|
+
// Filter out undefined/skipped modules from results (--skip-modules support)
|
|
40
|
+
const filteredResults = Object.fromEntries(Object.entries(results).filter(([_, v]) => v !== undefined));
|
|
41
|
+
const output = {
|
|
42
|
+
timestamp: new Date().toISOString(),
|
|
43
|
+
assessmentType: "full",
|
|
44
|
+
...filteredResults,
|
|
45
|
+
...(policyReport ? { policyCompliance: policyReport } : {}),
|
|
46
|
+
};
|
|
47
|
+
fs.writeFileSync(finalPath, JSON.stringify(output, null, 2));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// For other formats (markdown), use the formatter
|
|
51
|
+
const content = formatter.format(results);
|
|
52
|
+
fs.writeFileSync(finalPath, content);
|
|
53
|
+
}
|
|
54
|
+
return finalPath;
|
|
55
|
+
}
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Summary Display
|
|
58
|
+
// ============================================================================
|
|
59
|
+
/**
|
|
60
|
+
* Display summary to console
|
|
61
|
+
*/
|
|
62
|
+
export function displaySummary(results) {
|
|
63
|
+
const { overallStatus, summary, totalTestsRun, executionTime,
|
|
64
|
+
// Destructuring order matches display order below
|
|
65
|
+
functionality, security, documentation, errorHandling, usability, mcpSpecCompliance, aupCompliance, toolAnnotations, prohibitedLibraries, manifestValidation, portability, externalAPIScanner, authentication, temporal, resources, prompts, crossCapability, } = results;
|
|
66
|
+
console.log("\n" + "=".repeat(70));
|
|
67
|
+
console.log("FULL ASSESSMENT RESULTS");
|
|
68
|
+
console.log("=".repeat(70));
|
|
69
|
+
console.log(`Server: ${results.serverName}`);
|
|
70
|
+
console.log(`Overall Status: ${overallStatus}`);
|
|
71
|
+
console.log(`Total Tests Run: ${totalTestsRun}`);
|
|
72
|
+
console.log(`Execution Time: ${executionTime}ms`);
|
|
73
|
+
console.log("-".repeat(70));
|
|
74
|
+
console.log("\n📊 MODULE STATUS:");
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
const modules = [
|
|
77
|
+
["Functionality", functionality, "functionality"],
|
|
78
|
+
["Security", security, "security"],
|
|
79
|
+
["Documentation", documentation, "documentation"],
|
|
80
|
+
["Error Handling", errorHandling, "errorHandling"],
|
|
81
|
+
["Usability", usability, "usability"],
|
|
82
|
+
["MCP Spec Compliance", mcpSpecCompliance, "mcpSpecCompliance"],
|
|
83
|
+
["AUP Compliance", aupCompliance, "aupCompliance"],
|
|
84
|
+
["Tool Annotations", toolAnnotations, "toolAnnotations"],
|
|
85
|
+
["Prohibited Libraries", prohibitedLibraries, "prohibitedLibraries"],
|
|
86
|
+
["Manifest Validation", manifestValidation, "manifestValidation"],
|
|
87
|
+
["Portability", portability, "portability"],
|
|
88
|
+
["External API Scanner", externalAPIScanner, "externalAPIScanner"],
|
|
89
|
+
["Authentication", authentication, "authentication"],
|
|
90
|
+
["Temporal", temporal, "temporal"],
|
|
91
|
+
["Resources", resources, "resources"],
|
|
92
|
+
["Prompts", prompts, "prompts"],
|
|
93
|
+
["Cross-Capability", crossCapability, "crossCapability"],
|
|
94
|
+
];
|
|
95
|
+
for (const [name, module, categoryKey] of modules) {
|
|
96
|
+
if (module) {
|
|
97
|
+
const metadata = ASSESSMENT_CATEGORY_METADATA[categoryKey];
|
|
98
|
+
const optionalMarker = metadata?.tier === "optional" ? " (optional)" : "";
|
|
99
|
+
const icon = module.status === "PASS"
|
|
100
|
+
? "✅"
|
|
101
|
+
: module.status === "FAIL"
|
|
102
|
+
? "❌"
|
|
103
|
+
: "⚠️";
|
|
104
|
+
console.log(` ${icon} ${name}${optionalMarker}: ${module.status}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
console.log("\n📋 KEY FINDINGS:");
|
|
108
|
+
console.log(` ${summary}`);
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
|
+
const securityModule = security;
|
|
111
|
+
if (securityModule?.vulnerabilities?.length > 0) {
|
|
112
|
+
const vulns = securityModule.vulnerabilities;
|
|
113
|
+
console.log(`\n🔒 SECURITY VULNERABILITIES (${vulns.length}):`);
|
|
114
|
+
for (const vuln of vulns.slice(0, 5)) {
|
|
115
|
+
console.log(` • ${vuln}`);
|
|
116
|
+
}
|
|
117
|
+
if (vulns.length > 5) {
|
|
118
|
+
console.log(` ... and ${vulns.length - 5} more`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
122
|
+
const aupModule = aupCompliance;
|
|
123
|
+
if (aupModule?.violations?.length > 0) {
|
|
124
|
+
const violations = aupModule.violations;
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
const critical = violations.filter((v) => v.severity === "CRITICAL");
|
|
127
|
+
console.log(`\n⚖️ AUP FINDINGS:`);
|
|
128
|
+
console.log(` Total flagged: ${violations.length}`);
|
|
129
|
+
if (critical.length > 0) {
|
|
130
|
+
console.log(` 🚨 CRITICAL violations: ${critical.length}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
|
+
const annotationsModule = toolAnnotations;
|
|
135
|
+
if (annotationsModule) {
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
|
+
const funcModule = functionality;
|
|
138
|
+
console.log(`\n🏷️ TOOL ANNOTATIONS:`);
|
|
139
|
+
console.log(` Annotated: ${annotationsModule.annotatedCount || 0}/${funcModule?.workingTools || 0}`);
|
|
140
|
+
if (annotationsModule.missingAnnotationsCount > 0) {
|
|
141
|
+
console.log(` Missing: ${annotationsModule.missingAnnotationsCount}`);
|
|
142
|
+
}
|
|
143
|
+
if (annotationsModule.misalignedAnnotationsCount > 0) {
|
|
144
|
+
console.log(` ⚠️ Misalignments: ${annotationsModule.misalignedAnnotationsCount}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (results.recommendations?.length > 0) {
|
|
148
|
+
console.log("\n💡 RECOMMENDATIONS:");
|
|
149
|
+
for (const rec of results.recommendations.slice(0, 5)) {
|
|
150
|
+
console.log(` • ${rec}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
console.log("\n" + "=".repeat(70));
|
|
154
|
+
}
|
package/cli/package.json
CHANGED
|
@@ -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-
|
|
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-CCiX5wkF.js";
|
|
2
2
|
const OAuthCallback = ({ onConnect }) => {
|
|
3
3
|
const { toast } = useToast();
|
|
4
4
|
const hasProcessedRef = reactExports.useRef(false);
|
package/client/dist/assets/{OAuthDebugCallback-D1ImpKK5.js → OAuthDebugCallback-Nv-8u0GR.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-
|
|
1
|
+
import { r as reactExports, S as SESSION_KEYS, p as parseOAuthCallbackParams, j as jsxRuntimeExports, g as generateOAuthErrorDescription } from "./index-CCiX5wkF.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.
|
|
16376
|
+
const version$1 = "1.26.7";
|
|
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.
|
|
45291
|
+
const version = "1.26.7";
|
|
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-
|
|
48848
|
+
() => __vitePreload(() => import("./OAuthCallback-kF1MLuwg.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-
|
|
48854
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-Nv-8u0GR.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
|
}
|
package/client/dist/index.html
CHANGED
|
@@ -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-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CCiX5wkF.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-cHhcEXbr.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -50,6 +50,8 @@ export interface AssessmentConfiguration {
|
|
|
50
50
|
selectedToolsForTesting?: string[];
|
|
51
51
|
securityPatternsToTest?: number;
|
|
52
52
|
enableDomainTesting?: boolean;
|
|
53
|
+
/** Enable cross-tool sequence testing for privilege escalation (Issue #92, default true) */
|
|
54
|
+
enableSequenceTesting?: boolean;
|
|
53
55
|
mcpProtocolVersion?: string;
|
|
54
56
|
enableSourceCodeAnalysis?: boolean;
|
|
55
57
|
patternConfigPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configTypes.d.ts","sourceRoot":"","sources":["../../../src/lib/assessment/configTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,QAAQ,EACR,sBAAsB,EACvB,MAAM,kCAAkC,CAAC;AAG1C,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,yBAAyB,EAAE,OAAO,CAAC;QACnC,mBAAmB,EAAE,OAAO,CAAC;QAC7B,mBAAmB,EAAE,OAAO,CAAC;QAC7B,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,mBAAmB,CAAC;CAClC;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,MAAM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OAAO,CAAC;QACnB,6EAA6E;QAC7E,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAE5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAE7B,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;QAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;QAE1B,6EAA6E;QAC7E,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAMD,eAAO,MAAM,yBAAyB,EAAE,uBAoCvC,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,uBAqClC,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,uBAoCnC,CAAC;AAIF,eAAO,MAAM,iBAAiB,EAAE,uBAoC/B,CAAC;AAIF,eAAO,MAAM,4BAA4B,EAAE,uBA+C1C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Backend API Security Patterns
|
|
3
|
-
* Tests MCP server API security with
|
|
3
|
+
* Tests MCP server API security with 26 focused patterns
|
|
4
4
|
*
|
|
5
5
|
* Architecture: Attack-Type with Specific Payloads
|
|
6
6
|
* - Critical Injection (6 patterns): Command, Calculator, SQL, Path Traversal, XXE, NoSQL
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* - Token Theft (1 pattern): Authentication token leakage
|
|
13
13
|
* - Permission Scope (1 pattern): Privilege escalation and scope bypass
|
|
14
14
|
* - Auth Bypass (1 pattern): Fail-open authentication vulnerabilities (Issue #75)
|
|
15
|
+
* - Cross-Tool State Bypass (1 pattern): Cross-tool privilege escalation via shared state (Issue #92)
|
|
16
|
+
* - Chained Exploitation (1 pattern): Multi-tool chain execution attacks (Issue #93)
|
|
15
17
|
*
|
|
16
18
|
* Scope: Backend API Security ONLY
|
|
17
19
|
* - Tests structured data inputs to API endpoints
|
|
@@ -43,7 +45,7 @@ export interface AttackPattern {
|
|
|
43
45
|
* BACKEND API SECURITY PATTERNS
|
|
44
46
|
* ========================================
|
|
45
47
|
*
|
|
46
|
-
*
|
|
48
|
+
* 26 focused patterns for MCP server API security
|
|
47
49
|
*/
|
|
48
50
|
export declare const SECURITY_ATTACK_PATTERNS: AttackPattern[];
|
|
49
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"securityPatterns.d.ts","sourceRoot":"","sources":["../../src/lib/securityPatterns.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"securityPatterns.d.ts","sourceRoot":"","sources":["../../src/lib/securityPatterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;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,EAwjDnD,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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Backend API Security Patterns
|
|
3
|
-
* Tests MCP server API security with
|
|
3
|
+
* Tests MCP server API security with 26 focused patterns
|
|
4
4
|
*
|
|
5
5
|
* Architecture: Attack-Type with Specific Payloads
|
|
6
6
|
* - Critical Injection (6 patterns): Command, Calculator, SQL, Path Traversal, XXE, NoSQL
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* - Token Theft (1 pattern): Authentication token leakage
|
|
13
13
|
* - Permission Scope (1 pattern): Privilege escalation and scope bypass
|
|
14
14
|
* - Auth Bypass (1 pattern): Fail-open authentication vulnerabilities (Issue #75)
|
|
15
|
+
* - Cross-Tool State Bypass (1 pattern): Cross-tool privilege escalation via shared state (Issue #92)
|
|
16
|
+
* - Chained Exploitation (1 pattern): Multi-tool chain execution attacks (Issue #93)
|
|
15
17
|
*
|
|
16
18
|
* Scope: Backend API Security ONLY
|
|
17
19
|
* - Tests structured data inputs to API endpoints
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
* BACKEND API SECURITY PATTERNS
|
|
30
32
|
* ========================================
|
|
31
33
|
*
|
|
32
|
-
*
|
|
34
|
+
* 26 focused patterns for MCP server API security
|
|
33
35
|
*/
|
|
34
36
|
export const SECURITY_ATTACK_PATTERNS = [
|
|
35
37
|
// ==========================================
|
|
@@ -1315,6 +1317,148 @@ export const SECURITY_ATTACK_PATTERNS = [
|
|
|
1315
1317
|
},
|
|
1316
1318
|
],
|
|
1317
1319
|
},
|
|
1320
|
+
// ==========================================
|
|
1321
|
+
// CROSS-TOOL STATE BYPASS TESTS (Issue #92, Challenge #7)
|
|
1322
|
+
// ==========================================
|
|
1323
|
+
// 25. CROSS-TOOL STATE BYPASS
|
|
1324
|
+
{
|
|
1325
|
+
attackName: "Cross-Tool State Bypass",
|
|
1326
|
+
description: "Tests for privilege escalation via shared mutable state between tools (Challenge #7)",
|
|
1327
|
+
payloads: [
|
|
1328
|
+
// Admin action payloads - tests tools that check shared state
|
|
1329
|
+
{
|
|
1330
|
+
payload: "read secrets",
|
|
1331
|
+
evidence: /(admin_mode.*true.*cross-tool|enabled\s+by.*another\s+tool|"evidence".*privilege.*escalation)/i,
|
|
1332
|
+
riskLevel: "HIGH",
|
|
1333
|
+
description: "Admin action checking shared state for authorization",
|
|
1334
|
+
payloadType: "state_bypass",
|
|
1335
|
+
parameterTypes: ["action", "command", "request", "operation"],
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
payload: "delete user admin",
|
|
1339
|
+
evidence: /(admin_mode.*true.*privilege|destructive.*enabled.*cross-tool|"evidence".*state.*dependency)/i,
|
|
1340
|
+
riskLevel: "HIGH",
|
|
1341
|
+
description: "Destructive action via cross-tool state dependency",
|
|
1342
|
+
payloadType: "state_bypass",
|
|
1343
|
+
parameterTypes: ["action", "command", "request"],
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
payload: "modify config security=disabled",
|
|
1347
|
+
evidence: /(admin_mode.*enabled.*config|config\s+modification.*admin|privilege.*escalation.*config)/i,
|
|
1348
|
+
riskLevel: "HIGH",
|
|
1349
|
+
description: "Config modification via cross-tool privilege escalation",
|
|
1350
|
+
payloadType: "state_bypass",
|
|
1351
|
+
parameterTypes: ["action", "setting", "config"],
|
|
1352
|
+
},
|
|
1353
|
+
// State modifier payloads - tests tools that modify shared state
|
|
1354
|
+
{
|
|
1355
|
+
payload: "admin_mode=true",
|
|
1356
|
+
evidence: /(admin\s+mode\s+activated|elevated\s+privileges?\s+granted|admin_mode.*enabled)/i,
|
|
1357
|
+
riskLevel: "HIGH",
|
|
1358
|
+
description: "Tool modifies shared state affecting other tools' authorization",
|
|
1359
|
+
payloadType: "state_modifier",
|
|
1360
|
+
parameterTypes: ["setting", "config", "option"],
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
payload: "set admin_mode=true",
|
|
1364
|
+
evidence: /(admin\s+mode\s+activated|elevated\s+privileges?\s+granted|configuration.*updated.*admin)/i,
|
|
1365
|
+
riskLevel: "HIGH",
|
|
1366
|
+
description: "Explicit shared state modification request",
|
|
1367
|
+
payloadType: "state_modifier",
|
|
1368
|
+
parameterTypes: ["setting", "config", "option", "input"],
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
payload: "enable elevated privileges",
|
|
1372
|
+
evidence: /(elevated.*granted|privilege.*enabled|admin.*activated)/i,
|
|
1373
|
+
riskLevel: "HIGH",
|
|
1374
|
+
description: "Privilege elevation via shared state",
|
|
1375
|
+
payloadType: "state_modifier",
|
|
1376
|
+
parameterTypes: ["setting", "config", "option", "command"],
|
|
1377
|
+
},
|
|
1378
|
+
],
|
|
1379
|
+
},
|
|
1380
|
+
// ==========================================
|
|
1381
|
+
// CHAINED EXPLOITATION TESTS (Issue #93, Challenge #6)
|
|
1382
|
+
// ==========================================
|
|
1383
|
+
// 26. CHAINED EXPLOITATION
|
|
1384
|
+
{
|
|
1385
|
+
attackName: "Chained Exploitation",
|
|
1386
|
+
description: "Tests for multi-tool chain execution allowing arbitrary tool invocation, output injection, and recursive attacks",
|
|
1387
|
+
payloads: [
|
|
1388
|
+
// Single-step chain execution without allowlist
|
|
1389
|
+
{
|
|
1390
|
+
payload: '[{"tool": "vulnerable_calculator", "args": {"query": "2+2"}}]',
|
|
1391
|
+
evidence: /(chain_results|steps_executed|vulnerabilities_triggered|chain.*executed)/i,
|
|
1392
|
+
riskLevel: "HIGH",
|
|
1393
|
+
description: "Single-step chain execution without tool allowlist validation",
|
|
1394
|
+
payloadType: "chain_execution",
|
|
1395
|
+
parameterTypes: ["chain", "steps", "sequence", "pipeline"],
|
|
1396
|
+
},
|
|
1397
|
+
// Output injection via {{output}} template
|
|
1398
|
+
{
|
|
1399
|
+
payload: '[{"tool": "calc", "args": {"q": "2+2"}}, {"tool": "exec", "args": {"cmd": "{{output}}"}}]',
|
|
1400
|
+
evidence: /(output_injection|{{output}}.*substituted|\{\{output\}\}.*replaced|output.*injection.*step)/i,
|
|
1401
|
+
riskLevel: "HIGH",
|
|
1402
|
+
description: "Output injection - raw output flows between chain steps",
|
|
1403
|
+
payloadType: "chain_output_injection",
|
|
1404
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1405
|
+
},
|
|
1406
|
+
// Recursive chain (DoS via self-reference)
|
|
1407
|
+
{
|
|
1408
|
+
payload: '[{"tool": "vulnerable_chain_executor", "args": {"chain": "[]"}}]',
|
|
1409
|
+
evidence: /(recursive_chain|chain_executor.*within.*chain|circular.*chain|self.*referential)/i,
|
|
1410
|
+
riskLevel: "HIGH",
|
|
1411
|
+
description: "Recursive chain execution - DoS via self-referential chains",
|
|
1412
|
+
payloadType: "chain_recursion",
|
|
1413
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1414
|
+
},
|
|
1415
|
+
// Arbitrary tool name acceptance
|
|
1416
|
+
{
|
|
1417
|
+
payload: '[{"tool": "MALICIOUS_TOOL_12345", "args": {}}]',
|
|
1418
|
+
evidence: /(arbitrary.*tool|unknown.*tool.*executed|attempted.*execute.*unknown|accepted.*arbitrary)/i,
|
|
1419
|
+
riskLevel: "HIGH",
|
|
1420
|
+
description: "Chain accepts arbitrary tool names without allowlist",
|
|
1421
|
+
payloadType: "chain_arbitrary_tool",
|
|
1422
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1423
|
+
},
|
|
1424
|
+
// State poisoning via multi-step chain
|
|
1425
|
+
{
|
|
1426
|
+
payload: '[{"tool": "config_modifier", "args": {"setting": "admin=true"}}, {"tool": "admin_action", "args": {"action": "read secrets"}}]',
|
|
1427
|
+
evidence: /(state.*poison|admin_mode.*true.*chain|privilege.*escalation.*chain|config.*modified.*chain)/i,
|
|
1428
|
+
riskLevel: "HIGH",
|
|
1429
|
+
description: "State poisoning - earlier step modifies state affecting later steps",
|
|
1430
|
+
payloadType: "chain_state_poisoning",
|
|
1431
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1432
|
+
},
|
|
1433
|
+
// Depth limit bypass
|
|
1434
|
+
{
|
|
1435
|
+
payload: '[{"tool":"a"},{"tool":"b"},{"tool":"c"},{"tool":"d"},{"tool":"e"},{"tool":"f"},{"tool":"g"},{"tool":"h"},{"tool":"i"},{"tool":"j"},{"tool":"k"},{"tool":"l"}]',
|
|
1436
|
+
evidence: /(steps_executed.*1[0-9]|executed.*beyond.*limit|depth.*limit.*bypassed|no.*depth.*limit)/i,
|
|
1437
|
+
riskLevel: "MEDIUM",
|
|
1438
|
+
description: "Missing or bypassable chain depth limits",
|
|
1439
|
+
payloadType: "chain_depth_bypass",
|
|
1440
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1441
|
+
},
|
|
1442
|
+
// Tool shadowing via chain
|
|
1443
|
+
{
|
|
1444
|
+
payload: '[{"tool": "shadowed_tool_name", "args": {}}]',
|
|
1445
|
+
evidence: /(shadowed.*tool|tool.*poison|shadowed_definition|executed.*shadowed)/i,
|
|
1446
|
+
riskLevel: "HIGH",
|
|
1447
|
+
description: "Chain executes shadowed/poisoned tool definitions",
|
|
1448
|
+
payloadType: "chain_shadowing",
|
|
1449
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1450
|
+
},
|
|
1451
|
+
// Large chain input (unbounded input)
|
|
1452
|
+
{
|
|
1453
|
+
payload: '[{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}},{"tool":"t","args":{}}]',
|
|
1454
|
+
evidence: /(steps_executed.*[1-2][0-9]|no.*size.*limit|unbounded.*input|executed.*all.*steps)/i,
|
|
1455
|
+
riskLevel: "MEDIUM",
|
|
1456
|
+
description: "No input size validation on chain definitions",
|
|
1457
|
+
payloadType: "chain_unbounded",
|
|
1458
|
+
parameterTypes: ["chain", "steps", "sequence"],
|
|
1459
|
+
},
|
|
1460
|
+
],
|
|
1461
|
+
},
|
|
1318
1462
|
];
|
|
1319
1463
|
/**
|
|
1320
1464
|
* Get all payloads for an attack type
|
|
@@ -35,7 +35,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
35
35
|
* If Claude semantic analysis is enabled, violations are verified to reduce false positives.
|
|
36
36
|
*/
|
|
37
37
|
async assess(context) {
|
|
38
|
-
this.
|
|
38
|
+
this.logger.info("Starting AUP compliance assessment");
|
|
39
39
|
this.testCount = 0;
|
|
40
40
|
const violations = [];
|
|
41
41
|
const highRiskDomains = [];
|
|
@@ -51,7 +51,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
51
51
|
toolDescriptionMap.set(tool.name, tool.description || "");
|
|
52
52
|
}
|
|
53
53
|
// Scan tool names
|
|
54
|
-
this.
|
|
54
|
+
this.logger.info("Scanning tool names...");
|
|
55
55
|
scannedLocations.toolNames = true;
|
|
56
56
|
for (const tool of context.tools) {
|
|
57
57
|
this.testCount++;
|
|
@@ -66,7 +66,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
// Scan tool descriptions
|
|
69
|
-
this.
|
|
69
|
+
this.logger.info("Scanning tool descriptions...");
|
|
70
70
|
scannedLocations.toolDescriptions = true;
|
|
71
71
|
for (const tool of context.tools) {
|
|
72
72
|
if (tool.description) {
|
|
@@ -83,7 +83,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
83
83
|
}
|
|
84
84
|
// Scan README content
|
|
85
85
|
if (context.readmeContent) {
|
|
86
|
-
this.
|
|
86
|
+
this.logger.info("Scanning README content...");
|
|
87
87
|
scannedLocations.readme = true;
|
|
88
88
|
this.testCount++;
|
|
89
89
|
const readmeViolations = this.scanReadme(context.readmeContent);
|
|
@@ -97,7 +97,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
97
97
|
}
|
|
98
98
|
// Scan source code if available
|
|
99
99
|
if (context.sourceCodeFiles && context.config.enableSourceCodeAnalysis) {
|
|
100
|
-
this.
|
|
100
|
+
this.logger.info("Scanning source code files...");
|
|
101
101
|
scannedLocations.sourceCode = true;
|
|
102
102
|
for (const [filePath, content] of context.sourceCodeFiles) {
|
|
103
103
|
// Skip non-relevant files
|
|
@@ -110,14 +110,14 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
110
110
|
}
|
|
111
111
|
// If Claude semantic analysis is enabled, verify violations to reduce false positives
|
|
112
112
|
if (this.isSemanticAnalysisEnabled() && violations.length > 0) {
|
|
113
|
-
this.
|
|
113
|
+
this.logger.info(`Running semantic analysis on ${violations.length} potential violations...`);
|
|
114
114
|
return await this.runSemanticAnalysis(violations, highRiskDomains, scannedLocations, toolDescriptionMap);
|
|
115
115
|
}
|
|
116
116
|
// Standard assessment without semantic analysis
|
|
117
117
|
const status = this.determineAUPStatus(violations);
|
|
118
118
|
const explanation = this.generateExplanation(violations, highRiskDomains, scannedLocations);
|
|
119
119
|
const recommendations = this.generateRecommendations(violations, highRiskDomains);
|
|
120
|
-
this.
|
|
120
|
+
this.logger.info(`Assessment complete: ${violations.length} violations found, ${highRiskDomains.length} high-risk domains`);
|
|
121
121
|
return {
|
|
122
122
|
violations,
|
|
123
123
|
highRiskDomains,
|
|
@@ -185,7 +185,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
185
185
|
// Low confidence - likely false positive
|
|
186
186
|
else {
|
|
187
187
|
falsePositivesFiltered++;
|
|
188
|
-
this.
|
|
188
|
+
this.logger.info(`Filtered likely false positive: "${violation.matchedText}" - ${analysis.reasoning}`);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
catch (error) {
|
|
@@ -205,7 +205,7 @@ export class AUPComplianceAssessor extends BaseAssessor {
|
|
|
205
205
|
const status = this.determineAUPStatus(confirmedViolations);
|
|
206
206
|
const explanation = this.generateSemanticExplanation(confirmedViolations, flaggedForReview, falsePositivesFiltered, highRiskDomains, scannedLocations);
|
|
207
207
|
const recommendations = this.generateSemanticRecommendations(confirmedViolations, flaggedForReview, highRiskDomains);
|
|
208
|
-
this.
|
|
208
|
+
this.logger.info(`Semantic analysis complete: ${confirmedViolations.length} confirmed, ${flaggedForReview.length} flagged, ${falsePositivesFiltered} filtered`);
|
|
209
209
|
return {
|
|
210
210
|
violations: [...confirmedViolations, ...flaggedForReview],
|
|
211
211
|
confirmedViolations,
|