@bryan-thompson/inspector-assessment-client 1.26.6 → 1.27.0
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/dist/assets/{OAuthCallback-CCWVtjr7.js → OAuthCallback-CJWH8Ytw.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-DqbXfUi4.js → OAuthDebugCallback-DL5adXJw.js} +1 -1
- package/dist/assets/{index-CsDJSSWq.js → index-Cu9XzUwB.js} +4 -4
- package/dist/index.html +1 -1
- package/lib/lib/assessment/configTypes.d.ts +2 -0
- package/lib/lib/assessment/configTypes.d.ts.map +1 -1
- package/lib/lib/securityPatterns.d.ts +4 -2
- package/lib/lib/securityPatterns.d.ts.map +1 -1
- package/lib/lib/securityPatterns.js +146 -2
- package/lib/services/assessment/modules/AUPComplianceAssessor.js +9 -9
- package/lib/services/assessment/modules/AuthenticationAssessor.js +4 -4
- package/lib/services/assessment/modules/BaseAssessor.d.ts +0 -14
- package/lib/services/assessment/modules/BaseAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/BaseAssessor.js +1 -33
- package/lib/services/assessment/modules/CrossCapabilitySecurityAssessor.js +1 -1
- package/lib/services/assessment/modules/DeveloperExperienceAssessor.js +1 -1
- package/lib/services/assessment/modules/DocumentationAssessor.js +2 -2
- package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts +25 -0
- package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.js +127 -13
- package/lib/services/assessment/modules/ExternalAPIScannerAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ExternalAPIScannerAssessor.js +3 -3
- package/lib/services/assessment/modules/FunctionalityAssessor.js +9 -9
- package/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/MCPSpecComplianceAssessor.js +12 -12
- package/lib/services/assessment/modules/ManifestValidationAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ManifestValidationAssessor.js +9 -5
- package/lib/services/assessment/modules/PortabilityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/PortabilityAssessor.js +3 -3
- package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.js +4 -4
- package/lib/services/assessment/modules/PromptAssessor.js +2 -2
- package/lib/services/assessment/modules/ProtocolComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ProtocolComplianceAssessor.js +7 -7
- package/lib/services/assessment/modules/ProtocolConformanceAssessor.js +1 -1
- package/lib/services/assessment/modules/ResourceAssessor.js +1 -1
- package/lib/services/assessment/modules/SecurityAssessor.d.ts +25 -2
- package/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/SecurityAssessor.js +149 -17
- package/lib/services/assessment/modules/TemporalAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/TemporalAssessor.js +10 -10
- package/lib/services/assessment/modules/ToolAnnotationAssessor.js +9 -9
- package/lib/services/assessment/modules/UsabilityAssessor.js +1 -1
- package/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.d.ts.map +1 -1
- package/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.js +37 -0
- package/lib/services/assessment/modules/index.d.ts +3 -0
- package/lib/services/assessment/modules/index.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/ChainExecutionTester.d.ts +104 -0
- package/lib/services/assessment/modules/securityTests/ChainExecutionTester.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/ChainExecutionTester.js +257 -0
- package/lib/services/assessment/modules/securityTests/CrossToolStateTester.d.ts +91 -0
- package/lib/services/assessment/modules/securityTests/CrossToolStateTester.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/CrossToolStateTester.js +225 -0
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +120 -0
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +338 -0
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +59 -0
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +168 -0
- package/lib/services/assessment/modules/securityTests/index.d.ts +3 -1
- package/lib/services/assessment/modules/securityTests/index.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/index.js +2 -0
- package/package.json +1 -1
|
@@ -19,6 +19,8 @@ import { ExecutionArtifactDetector } from "./ExecutionArtifactDetector.js";
|
|
|
19
19
|
import { MathAnalyzer } from "./MathAnalyzer.js";
|
|
20
20
|
import { SafeResponseDetector } from "./SafeResponseDetector.js";
|
|
21
21
|
import { ConfidenceScorer } from "./ConfidenceScorer.js";
|
|
22
|
+
// Import pattern library for chain exploitation analysis
|
|
23
|
+
import { CHAIN_EXPLOIT_VULNERABLE_PATTERNS, CHAIN_EXPLOIT_SAFE_PATTERNS, CHAIN_VULNERABLE_THRESHOLD, CHAIN_SAFE_THRESHOLD, detectVulnerabilityCategories, } from "./SecurityPatternLibrary.js";
|
|
22
24
|
/**
|
|
23
25
|
* Analyzes tool responses for security vulnerabilities
|
|
24
26
|
* Distinguishes between safe reflection and actual execution
|
|
@@ -153,6 +155,172 @@ export class SecurityResponseAnalyzer {
|
|
|
153
155
|
}
|
|
154
156
|
return { detected: false, failureMode: "UNKNOWN" };
|
|
155
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Analyze response for cross-tool state-based authorization bypass (Issue #92)
|
|
160
|
+
* Detects Challenge #7: Privilege escalation via shared mutable state
|
|
161
|
+
*
|
|
162
|
+
* Vulnerable pattern: Tool checks shared state (e.g., config_state["admin_mode"])
|
|
163
|
+
* that can be modified by another tool (e.g., config_modifier)
|
|
164
|
+
*
|
|
165
|
+
* Safe pattern: Tool uses independent per-request authorization,
|
|
166
|
+
* indicated by shared_state_checked: false or independent_auth_required: true
|
|
167
|
+
*/
|
|
168
|
+
analyzeStateBasedAuthBypass(response) {
|
|
169
|
+
const responseText = this.extractResponseContent(response);
|
|
170
|
+
// Vulnerable patterns - shared state authorization (Challenge #7)
|
|
171
|
+
const vulnerablePatterns = [
|
|
172
|
+
{
|
|
173
|
+
pattern: /"admin_mode"\s*:\s*true/i,
|
|
174
|
+
evidence: "admin_mode enabled in response",
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
pattern: /hint.*use\s+config_modifier/i,
|
|
178
|
+
evidence: "Tool hints at cross-tool state dependency",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
pattern: /admin_mode.*set\s+by.*another\s+tool/i,
|
|
182
|
+
evidence: "Explicit cross-tool state dependency",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
pattern: /"evidence".*cross-tool.*privilege/i,
|
|
186
|
+
evidence: "Cross-tool privilege escalation detected",
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
pattern: /elevated\s+privileges?\s+granted/i,
|
|
190
|
+
evidence: "Elevated privileges granted",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
pattern: /admin\s+mode\s+activated/i,
|
|
194
|
+
evidence: "Admin mode activated (state modifier)",
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
pattern: /"hint".*config_modifier.*admin_mode/i,
|
|
198
|
+
evidence: "Response hints at config_modifier for admin_mode",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
pattern: /Use\s+config_modifier.*enable.*admin_mode/i,
|
|
202
|
+
evidence: "Tool depends on config_modifier for authorization",
|
|
203
|
+
},
|
|
204
|
+
];
|
|
205
|
+
// Safe patterns - independent authorization (secure)
|
|
206
|
+
const safePatterns = [
|
|
207
|
+
{
|
|
208
|
+
pattern: /"shared_state_checked"\s*:\s*false/i,
|
|
209
|
+
evidence: "Tool explicitly states it doesn't use shared state",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
pattern: /"independent_auth_required"\s*:\s*true/i,
|
|
213
|
+
evidence: "Tool requires independent per-request auth",
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
pattern: /requires\s+independent\s+authorization/i,
|
|
217
|
+
evidence: "Independent authorization required",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
pattern: /(?:not|does\s+not|doesn't)\s+(?:use\s+)?shared\s+state/i,
|
|
221
|
+
evidence: "Tool confirms it does not use shared state",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
pattern: /stored.*for.*admin.*review/i,
|
|
225
|
+
evidence: "Request stored for admin review (no auto-execution)",
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
pattern: /per-request\s+auth/i,
|
|
229
|
+
evidence: "Per-request authentication enforced",
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
// Check vulnerable patterns first (SHARED_STATE)
|
|
233
|
+
for (const { pattern, evidence } of vulnerablePatterns) {
|
|
234
|
+
if (pattern.test(responseText)) {
|
|
235
|
+
return {
|
|
236
|
+
vulnerable: true,
|
|
237
|
+
safe: false,
|
|
238
|
+
stateDependency: "SHARED_STATE",
|
|
239
|
+
evidence: `Cross-tool state dependency detected: ${evidence}`,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Check safe patterns (INDEPENDENT)
|
|
244
|
+
for (const { pattern, evidence } of safePatterns) {
|
|
245
|
+
if (pattern.test(responseText)) {
|
|
246
|
+
return {
|
|
247
|
+
vulnerable: false,
|
|
248
|
+
safe: true,
|
|
249
|
+
stateDependency: "INDEPENDENT",
|
|
250
|
+
evidence: `Independent authorization confirmed: ${evidence}`,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
vulnerable: false,
|
|
256
|
+
safe: false,
|
|
257
|
+
stateDependency: "UNKNOWN",
|
|
258
|
+
evidence: "",
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Analyze response for chain exploitation vulnerabilities (Issue #93, Challenge #6)
|
|
263
|
+
* Detects multi-tool chained exploitation attacks including:
|
|
264
|
+
* - Arbitrary tool invocation without allowlist
|
|
265
|
+
* - Output injection via {{output}} template substitution
|
|
266
|
+
* - Recursive/circular chain execution (DoS potential)
|
|
267
|
+
* - State poisoning between chain steps
|
|
268
|
+
* - Tool shadowing in chains
|
|
269
|
+
* - Missing depth/size limits
|
|
270
|
+
*
|
|
271
|
+
* @param response The tool response to analyze
|
|
272
|
+
* @returns Analysis result with vulnerability status and evidence
|
|
273
|
+
*/
|
|
274
|
+
analyzeChainExploitation(response) {
|
|
275
|
+
const responseText = this.extractResponseContent(response);
|
|
276
|
+
let vulnerableScore = 0;
|
|
277
|
+
let safeScore = 0;
|
|
278
|
+
const matchedVulnPatterns = [];
|
|
279
|
+
const matchedSafePatterns = [];
|
|
280
|
+
// Check vulnerable patterns
|
|
281
|
+
for (const patternDef of CHAIN_EXPLOIT_VULNERABLE_PATTERNS) {
|
|
282
|
+
if (patternDef.pattern.test(responseText)) {
|
|
283
|
+
vulnerableScore += patternDef.weight;
|
|
284
|
+
matchedVulnPatterns.push(patternDef.description);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// Check safe patterns
|
|
288
|
+
for (const patternDef of CHAIN_EXPLOIT_SAFE_PATTERNS) {
|
|
289
|
+
if (patternDef.pattern.test(responseText)) {
|
|
290
|
+
safeScore += patternDef.weight;
|
|
291
|
+
matchedSafePatterns.push(patternDef.description);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
// Determine chain execution type using documented thresholds
|
|
295
|
+
let chainType = "UNKNOWN";
|
|
296
|
+
if (vulnerableScore > CHAIN_VULNERABLE_THRESHOLD &&
|
|
297
|
+
vulnerableScore > safeScore) {
|
|
298
|
+
chainType = "VULNERABLE_EXECUTION";
|
|
299
|
+
}
|
|
300
|
+
else if (safeScore > CHAIN_SAFE_THRESHOLD &&
|
|
301
|
+
safeScore > vulnerableScore) {
|
|
302
|
+
chainType = "SAFE_VALIDATION";
|
|
303
|
+
}
|
|
304
|
+
else if (vulnerableScore > 0 || safeScore > 0) {
|
|
305
|
+
chainType = "PARTIAL";
|
|
306
|
+
}
|
|
307
|
+
// Detect specific vulnerability categories using centralized pattern library
|
|
308
|
+
const detectedCategories = detectVulnerabilityCategories(responseText);
|
|
309
|
+
const vulnerabilityCategories = detectedCategories;
|
|
310
|
+
return {
|
|
311
|
+
vulnerable: vulnerableScore > CHAIN_VULNERABLE_THRESHOLD &&
|
|
312
|
+
vulnerableScore > safeScore,
|
|
313
|
+
safe: safeScore > CHAIN_SAFE_THRESHOLD && safeScore > vulnerableScore,
|
|
314
|
+
chainType,
|
|
315
|
+
vulnerabilityCategories,
|
|
316
|
+
evidence: {
|
|
317
|
+
vulnerablePatterns: matchedVulnPatterns,
|
|
318
|
+
safePatterns: matchedSafePatterns,
|
|
319
|
+
vulnerableScore,
|
|
320
|
+
safeScore,
|
|
321
|
+
},
|
|
322
|
+
};
|
|
323
|
+
}
|
|
156
324
|
/**
|
|
157
325
|
* Check if response indicates connection/server failure
|
|
158
326
|
*/
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* Security Assessment Module
|
|
3
3
|
* Exports all security-related components
|
|
4
4
|
*/
|
|
5
|
-
export { SecurityResponseAnalyzer, type ConfidenceResult, type AnalysisResult, type ErrorClassification, } from "./SecurityResponseAnalyzer.js";
|
|
5
|
+
export { SecurityResponseAnalyzer, type ConfidenceResult, type AnalysisResult, type ErrorClassification, type StateBasedAuthResult, type ChainExploitationAnalysis, type ChainExecutionType, type ChainVulnerabilityCategory, } from "./SecurityResponseAnalyzer.js";
|
|
6
6
|
export { SecurityPayloadTester, type TestProgressCallback, type PayloadTestConfig, type TestLogger, } from "./SecurityPayloadTester.js";
|
|
7
7
|
export { SecurityPayloadGenerator } from "./SecurityPayloadGenerator.js";
|
|
8
|
+
export { CrossToolStateTester, type CrossToolTestResult, type ToolPair, type CallToolFunction, type CrossToolTestConfig, } from "./CrossToolStateTester.js";
|
|
9
|
+
export { ChainExecutionTester, type ChainExecutionTestResult, type ChainExploitationSummary, type ChainExecutionTesterConfig, type ChainTestReason, } from "./ChainExecutionTester.js";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,wBAAwB,EACxB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,UAAU,GAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC"}
|
|
@@ -5,3 +5,5 @@
|
|
|
5
5
|
export { SecurityResponseAnalyzer, } from "./SecurityResponseAnalyzer.js";
|
|
6
6
|
export { SecurityPayloadTester, } from "./SecurityPayloadTester.js";
|
|
7
7
|
export { SecurityPayloadGenerator } from "./SecurityPayloadGenerator.js";
|
|
8
|
+
export { CrossToolStateTester, } from "./CrossToolStateTester.js";
|
|
9
|
+
export { ChainExecutionTester, } from "./ChainExecutionTester.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bryan-thompson/inspector-assessment-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "Client-side application for the Enhanced MCP Inspector with assessment capabilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bryan Thompson <bryan@triepod.ai>",
|