@bryan-thompson/inspector-assessment-client 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/dist/assets/{OAuthCallback-DpdInvWI.js → OAuthCallback-CCWVtjr7.js} +1 -1
- package/dist/assets/{OAuthDebugCallback-D1ImpKK5.js → OAuthDebugCallback-DqbXfUi4.js} +1 -1
- package/dist/assets/{index-umcoGmYw.js → index-CsDJSSWq.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.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.js +8 -8
- 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/ConfidenceScorer.d.ts +57 -0
- package/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/ConfidenceScorer.js +199 -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/ErrorClassifier.d.ts +57 -0
- package/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/ErrorClassifier.js +113 -0
- package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts +49 -0
- package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.js +74 -0
- package/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts +58 -0
- package/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/MathAnalyzer.js +251 -0
- package/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts +59 -0
- package/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/SafeResponseDetector.js +151 -0
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +349 -0
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -0
- package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +904 -0
- package/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.js +49 -24
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +122 -85
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +443 -1176
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityPayloadGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityPayloadGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,iBAAiB,CAAuC;IAEhE;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAUvC;;OAEG;IACH,oBAAoB,CAClB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,IAAI,GACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SecurityPayloadGenerator.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityPayloadGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIzD;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,iBAAiB,CAAuC;IAEhE;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IAUvC;;OAEG;IACH,oBAAoB,CAClB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,IAAI,GACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAwJ1B;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO;IASjC;;;OAGG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;CAQ7C"}
|
|
@@ -31,7 +31,55 @@ export class SecurityPayloadGenerator {
|
|
|
31
31
|
const params = {};
|
|
32
32
|
const targetParamTypes = payload.parameterTypes || [];
|
|
33
33
|
let payloadInjected = false;
|
|
34
|
-
//
|
|
34
|
+
// PRIORITY 1: Handle auth payloads first (Issue #81)
|
|
35
|
+
// These MUST go to token/auth parameters, not language-detected params
|
|
36
|
+
if (!payloadInjected && payload.payloadType === "auth") {
|
|
37
|
+
const authParams = [
|
|
38
|
+
"token",
|
|
39
|
+
"auth_token",
|
|
40
|
+
"authorization",
|
|
41
|
+
"api_key",
|
|
42
|
+
"access_token",
|
|
43
|
+
];
|
|
44
|
+
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
45
|
+
const propSchema = prop;
|
|
46
|
+
if (propSchema.type === "string") {
|
|
47
|
+
for (const authParam of authParams) {
|
|
48
|
+
if (key.toLowerCase().includes(authParam.toLowerCase())) {
|
|
49
|
+
params[key] = payload.payload;
|
|
50
|
+
payloadInjected = true;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (payloadInjected)
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// PRIORITY 2: Handle auth_failure payloads (Issue #79)
|
|
60
|
+
// These MUST go to simulate_failure parameters
|
|
61
|
+
if (!payloadInjected && payload.payloadType === "auth_failure") {
|
|
62
|
+
const authFailureParams = [
|
|
63
|
+
"simulate_failure",
|
|
64
|
+
"failure_mode",
|
|
65
|
+
"failure_type",
|
|
66
|
+
];
|
|
67
|
+
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
68
|
+
const propSchema = prop;
|
|
69
|
+
if (propSchema.type === "string") {
|
|
70
|
+
for (const failParam of authFailureParams) {
|
|
71
|
+
if (key.toLowerCase().includes(failParam.toLowerCase())) {
|
|
72
|
+
params[key] = payload.payload;
|
|
73
|
+
payloadInjected = true;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (payloadInjected)
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// PRIORITY 3: Check for language-specific code execution parameters
|
|
35
83
|
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
36
84
|
const propSchema = prop;
|
|
37
85
|
if (propSchema.type !== "string")
|
|
@@ -71,29 +119,6 @@ export class SecurityPayloadGenerator {
|
|
|
71
119
|
}
|
|
72
120
|
}
|
|
73
121
|
}
|
|
74
|
-
// Special handling for auth_failure payloads (Issue #79)
|
|
75
|
-
// These target simulate_failure parameters to test fail-open behavior
|
|
76
|
-
if (!payloadInjected && payload.payloadType === "auth_failure") {
|
|
77
|
-
const authFailureParams = [
|
|
78
|
-
"simulate_failure",
|
|
79
|
-
"failure_mode",
|
|
80
|
-
"failure_type",
|
|
81
|
-
];
|
|
82
|
-
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
83
|
-
const propSchema = prop;
|
|
84
|
-
if (propSchema.type === "string") {
|
|
85
|
-
for (const failParam of authFailureParams) {
|
|
86
|
-
if (key.toLowerCase().includes(failParam.toLowerCase())) {
|
|
87
|
-
params[key] = payload.payload;
|
|
88
|
-
payloadInjected = true;
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (payloadInjected)
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
122
|
// Fall back to generic payload - inject into first string parameter
|
|
98
123
|
if (!payloadInjected) {
|
|
99
124
|
for (const [key, prop] of Object.entries(schema.properties)) {
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Security Response Analyzer
|
|
2
|
+
* Security Response Analyzer (Facade)
|
|
3
3
|
* Analyzes tool responses for evidence-based vulnerability detection
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* REFACTORED in Issue #53 (v2.0.0): Converted to facade pattern
|
|
6
|
+
* Delegates to focused classes for maintainability (CC 218 → ~50)
|
|
7
|
+
*
|
|
8
|
+
* Extracted classes:
|
|
9
|
+
* - ErrorClassifier: Error classification and connection error detection
|
|
10
|
+
* - ExecutionArtifactDetector: Execution evidence detection
|
|
11
|
+
* - MathAnalyzer: Math computation detection (Calculator Injection)
|
|
12
|
+
* - SafeResponseDetector: Safe response pattern detection
|
|
13
|
+
* - ConfidenceScorer: Confidence level calculation
|
|
7
14
|
*/
|
|
8
15
|
import { CompatibilityCallToolResult, Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
9
16
|
import { SecurityPayload } from "../../../../lib/securityPatterns.js";
|
|
10
17
|
import type { SanitizationDetectionResult } from "./SanitizationDetector.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
confidence: "high" | "medium" | "low";
|
|
16
|
-
requiresManualReview: boolean;
|
|
17
|
-
manualReviewReason?: string;
|
|
18
|
-
reviewGuidance?: string;
|
|
19
|
-
}
|
|
18
|
+
import { MathResultAnalysis } from "./MathAnalyzer.js";
|
|
19
|
+
import { ConfidenceResult } from "./ConfidenceScorer.js";
|
|
20
|
+
export type { ConfidenceResult } from "./ConfidenceScorer.js";
|
|
21
|
+
export type { MathResultAnalysis } from "./MathAnalyzer.js";
|
|
20
22
|
/**
|
|
21
23
|
* Result of response analysis
|
|
22
24
|
*/
|
|
@@ -24,14 +26,6 @@ export interface AnalysisResult {
|
|
|
24
26
|
isVulnerable: boolean;
|
|
25
27
|
evidence?: string;
|
|
26
28
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Result of computed math analysis with confidence level (Issue #58)
|
|
29
|
-
*/
|
|
30
|
-
export interface MathResultAnalysis {
|
|
31
|
-
isComputed: boolean;
|
|
32
|
-
confidence: "high" | "medium" | "low";
|
|
33
|
-
reason?: string;
|
|
34
|
-
}
|
|
35
29
|
/**
|
|
36
30
|
* Result of auth bypass response analysis (Issue #75)
|
|
37
31
|
* Detects fail-open authentication vulnerabilities (CVE-2025-52882)
|
|
@@ -41,6 +35,40 @@ export interface AuthBypassResult {
|
|
|
41
35
|
failureMode: "FAIL_OPEN" | "FAIL_CLOSED" | "UNKNOWN";
|
|
42
36
|
evidence?: string;
|
|
43
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Result of cross-tool state-based auth bypass analysis (Issue #92, Challenge #7)
|
|
40
|
+
* Detects privilege escalation via shared mutable state between tools
|
|
41
|
+
*/
|
|
42
|
+
export interface StateBasedAuthResult {
|
|
43
|
+
vulnerable: boolean;
|
|
44
|
+
safe: boolean;
|
|
45
|
+
stateDependency: "SHARED_STATE" | "INDEPENDENT" | "UNKNOWN";
|
|
46
|
+
evidence: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Chain execution type classification (Issue #93, Challenge #6)
|
|
50
|
+
*/
|
|
51
|
+
export type ChainExecutionType = "VULNERABLE_EXECUTION" | "SAFE_VALIDATION" | "PARTIAL" | "UNKNOWN";
|
|
52
|
+
/**
|
|
53
|
+
* Chain vulnerability categories (Issue #93, Challenge #6)
|
|
54
|
+
*/
|
|
55
|
+
export type ChainVulnerabilityCategory = "OUTPUT_INJECTION" | "RECURSIVE_CHAIN" | "ARBITRARY_TOOL_INVOCATION" | "TOOL_SHADOWING" | "MISSING_DEPTH_LIMIT" | "STATE_POISONING";
|
|
56
|
+
/**
|
|
57
|
+
* Result of chain exploitation analysis (Issue #93, Challenge #6)
|
|
58
|
+
* Detects multi-tool chained exploitation attacks
|
|
59
|
+
*/
|
|
60
|
+
export interface ChainExploitationAnalysis {
|
|
61
|
+
vulnerable: boolean;
|
|
62
|
+
safe: boolean;
|
|
63
|
+
chainType: ChainExecutionType;
|
|
64
|
+
vulnerabilityCategories: ChainVulnerabilityCategory[];
|
|
65
|
+
evidence: {
|
|
66
|
+
vulnerablePatterns: string[];
|
|
67
|
+
safePatterns: string[];
|
|
68
|
+
vulnerableScore: number;
|
|
69
|
+
safeScore: number;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
44
72
|
/**
|
|
45
73
|
* Error classification types
|
|
46
74
|
*/
|
|
@@ -48,8 +76,17 @@ export type ErrorClassification = "connection" | "server" | "protocol";
|
|
|
48
76
|
/**
|
|
49
77
|
* Analyzes tool responses for security vulnerabilities
|
|
50
78
|
* Distinguishes between safe reflection and actual execution
|
|
79
|
+
*
|
|
80
|
+
* This class serves as a facade, delegating to focused analyzers
|
|
81
|
+
* while maintaining the same public API for backward compatibility.
|
|
51
82
|
*/
|
|
52
83
|
export declare class SecurityResponseAnalyzer {
|
|
84
|
+
private errorClassifier;
|
|
85
|
+
private executionDetector;
|
|
86
|
+
private mathAnalyzer;
|
|
87
|
+
private safeDetector;
|
|
88
|
+
private confidenceScorer;
|
|
89
|
+
constructor();
|
|
53
90
|
/**
|
|
54
91
|
* Analyze response with evidence-based detection
|
|
55
92
|
* CRITICAL: Distinguish between safe reflection and actual execution
|
|
@@ -59,24 +96,59 @@ export declare class SecurityResponseAnalyzer {
|
|
|
59
96
|
*/
|
|
60
97
|
analyzeResponse(response: CompatibilityCallToolResult, payload: SecurityPayload, tool: Tool): AnalysisResult;
|
|
61
98
|
/**
|
|
62
|
-
*
|
|
63
|
-
* Handles: MCP validation errors (-32602), HTTP 4xx/5xx errors
|
|
99
|
+
* Calculate confidence level and manual review requirements
|
|
64
100
|
*/
|
|
65
|
-
|
|
101
|
+
calculateConfidence(tool: Tool, isVulnerable: boolean, evidence: string, responseText: string, payload: SecurityPayload, sanitizationResult?: SanitizationDetectionResult): ConfidenceResult;
|
|
66
102
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
103
|
+
* Analyze response for auth bypass patterns (Issue #75)
|
|
104
|
+
* Detects fail-open authentication vulnerabilities (CVE-2025-52882)
|
|
69
105
|
*/
|
|
70
|
-
|
|
106
|
+
analyzeAuthBypassResponse(response: CompatibilityCallToolResult): AuthBypassResult;
|
|
71
107
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
108
|
+
* Analyze response for cross-tool state-based authorization bypass (Issue #92)
|
|
109
|
+
* Detects Challenge #7: Privilege escalation via shared mutable state
|
|
110
|
+
*
|
|
111
|
+
* Vulnerable pattern: Tool checks shared state (e.g., config_state["admin_mode"])
|
|
112
|
+
* that can be modified by another tool (e.g., config_modifier)
|
|
113
|
+
*
|
|
114
|
+
* Safe pattern: Tool uses independent per-request authorization,
|
|
115
|
+
* indicated by shared_state_checked: false or independent_auth_required: true
|
|
116
|
+
*/
|
|
117
|
+
analyzeStateBasedAuthBypass(response: CompatibilityCallToolResult): StateBasedAuthResult;
|
|
118
|
+
/**
|
|
119
|
+
* Analyze response for chain exploitation vulnerabilities (Issue #93, Challenge #6)
|
|
120
|
+
* Detects multi-tool chained exploitation attacks including:
|
|
121
|
+
* - Arbitrary tool invocation without allowlist
|
|
122
|
+
* - Output injection via {{output}} template substitution
|
|
123
|
+
* - Recursive/circular chain execution (DoS potential)
|
|
124
|
+
* - State poisoning between chain steps
|
|
125
|
+
* - Tool shadowing in chains
|
|
126
|
+
* - Missing depth/size limits
|
|
127
|
+
*
|
|
128
|
+
* @param response The tool response to analyze
|
|
129
|
+
* @returns Analysis result with vulnerability status and evidence
|
|
74
130
|
*/
|
|
75
|
-
|
|
131
|
+
analyzeChainExploitation(response: CompatibilityCallToolResult): ChainExploitationAnalysis;
|
|
76
132
|
/**
|
|
77
|
-
* Check if
|
|
133
|
+
* Check if response indicates connection/server failure
|
|
78
134
|
*/
|
|
79
|
-
|
|
135
|
+
isConnectionError(response: CompatibilityCallToolResult): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Check if caught exception indicates connection/server failure
|
|
138
|
+
*/
|
|
139
|
+
isConnectionErrorFromException(error: unknown): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Classify error type for reporting
|
|
142
|
+
*/
|
|
143
|
+
classifyError(response: CompatibilityCallToolResult): ErrorClassification;
|
|
144
|
+
/**
|
|
145
|
+
* Classify error type from caught exception
|
|
146
|
+
*/
|
|
147
|
+
classifyErrorFromException(error: unknown): ErrorClassification;
|
|
148
|
+
/**
|
|
149
|
+
* Extract response content from MCP response
|
|
150
|
+
*/
|
|
151
|
+
extractResponseContent(response: CompatibilityCallToolResult): string;
|
|
80
152
|
/**
|
|
81
153
|
* Check if response is an MCP validation error (safe rejection)
|
|
82
154
|
*/
|
|
@@ -98,45 +170,19 @@ export declare class SecurityResponseAnalyzer {
|
|
|
98
170
|
hasExecutionEvidence(responseText: string): boolean;
|
|
99
171
|
/**
|
|
100
172
|
* Check if a math expression payload was computed (execution evidence)
|
|
173
|
+
* @deprecated Use analyzeComputedMathResult instead
|
|
101
174
|
*/
|
|
102
175
|
isComputedMathResult(payload: string, responseText: string): boolean;
|
|
103
176
|
/**
|
|
104
|
-
* Check if numeric value appears in structured data context
|
|
105
|
-
* Distinguishes {"records": 4} from computed "4" (Issue #58)
|
|
106
|
-
*
|
|
107
|
-
* @param result The computed numeric result to check for
|
|
108
|
-
* @param responseText The response text to analyze
|
|
109
|
-
* @returns true if the number appears to be coincidental data, not a computed result
|
|
177
|
+
* Check if numeric value appears in structured data context
|
|
110
178
|
*/
|
|
111
179
|
isCoincidentalNumericInStructuredData(result: number, responseText: string): boolean;
|
|
112
180
|
/**
|
|
113
181
|
* Enhanced computed math result analysis with tool context (Issue #58)
|
|
114
|
-
*
|
|
115
|
-
* Returns a confidence level indicating how likely this is a real Calculator Injection:
|
|
116
|
-
* - high: Strong evidence of computation (should flag as vulnerable)
|
|
117
|
-
* - medium: Ambiguous (excluded from vulnerability count per user decision)
|
|
118
|
-
* - low: Likely coincidental data (excluded from vulnerability count)
|
|
119
182
|
*/
|
|
120
183
|
analyzeComputedMathResult(payload: string, responseText: string, tool?: Tool): MathResultAnalysis;
|
|
121
|
-
/**
|
|
122
|
-
* Check if response indicates connection/server failure
|
|
123
|
-
*/
|
|
124
|
-
isConnectionError(response: CompatibilityCallToolResult): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if caught exception indicates connection/server failure
|
|
127
|
-
*/
|
|
128
|
-
isConnectionErrorFromException(error: unknown): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Classify error type for reporting
|
|
131
|
-
*/
|
|
132
|
-
classifyError(response: CompatibilityCallToolResult): ErrorClassification;
|
|
133
|
-
/**
|
|
134
|
-
* Classify error type from caught exception
|
|
135
|
-
*/
|
|
136
|
-
classifyErrorFromException(error: unknown): ErrorClassification;
|
|
137
184
|
/**
|
|
138
185
|
* Check if response is just reflection (safe)
|
|
139
|
-
* Two-layer defense: Match reflection patterns, verify NO execution evidence
|
|
140
186
|
*/
|
|
141
187
|
isReflectionResponse(responseText: string): boolean;
|
|
142
188
|
/**
|
|
@@ -148,21 +194,9 @@ export declare class SecurityResponseAnalyzer {
|
|
|
148
194
|
*/
|
|
149
195
|
containsEchoedInjectionPayload(responseText: string): boolean;
|
|
150
196
|
/**
|
|
151
|
-
*
|
|
152
|
-
*/
|
|
153
|
-
analyzeInjectionResponse(response: CompatibilityCallToolResult, _payload: string): AnalysisResult;
|
|
154
|
-
/**
|
|
155
|
-
* Calculate confidence level and manual review requirements
|
|
156
|
-
*
|
|
157
|
-
* @param tool - The tool being tested
|
|
158
|
-
* @param isVulnerable - Whether the tool was flagged as vulnerable
|
|
159
|
-
* @param evidence - Evidence string from vulnerability detection
|
|
160
|
-
* @param responseText - The response text from the tool
|
|
161
|
-
* @param payload - The security payload used for testing
|
|
162
|
-
* @param sanitizationResult - Optional sanitization detection result (Issue #56)
|
|
163
|
-
* @returns Confidence result with manual review requirements
|
|
197
|
+
* Check if tool explicitly rejected input with validation error (SAFE)
|
|
164
198
|
*/
|
|
165
|
-
|
|
199
|
+
isValidationRejection(response: CompatibilityCallToolResult): boolean;
|
|
166
200
|
/**
|
|
167
201
|
* Check if tool is a structured data tool
|
|
168
202
|
*/
|
|
@@ -171,25 +205,28 @@ export declare class SecurityResponseAnalyzer {
|
|
|
171
205
|
* Check if response is returning search results
|
|
172
206
|
*/
|
|
173
207
|
isSearchResultResponse(responseText: string): boolean;
|
|
174
|
-
/**
|
|
175
|
-
* Analyze response for auth bypass patterns (Issue #75)
|
|
176
|
-
* Detects fail-open authentication vulnerabilities (CVE-2025-52882)
|
|
177
|
-
*
|
|
178
|
-
* @param response The tool response to analyze
|
|
179
|
-
* @returns AuthBypassResult with detection status and failure mode classification
|
|
180
|
-
*/
|
|
181
|
-
analyzeAuthBypassResponse(response: CompatibilityCallToolResult): AuthBypassResult;
|
|
182
208
|
/**
|
|
183
209
|
* Check if response is from a creation/modification operation
|
|
184
210
|
*/
|
|
185
211
|
isCreationResponse(responseText: string): boolean;
|
|
186
212
|
/**
|
|
187
|
-
*
|
|
213
|
+
* Check for safe error responses that indicate proper input rejection
|
|
214
|
+
* Handles: MCP validation errors (-32602), HTTP 4xx/5xx errors
|
|
188
215
|
*/
|
|
189
|
-
|
|
216
|
+
private checkSafeErrorResponses;
|
|
217
|
+
/**
|
|
218
|
+
* Check for safe tool behavior patterns
|
|
219
|
+
* Handles: Tool categories, reflection, computed math, validation rejection
|
|
220
|
+
*/
|
|
221
|
+
private checkSafeToolBehavior;
|
|
190
222
|
/**
|
|
191
|
-
*
|
|
223
|
+
* Check for vulnerability evidence in response
|
|
224
|
+
* Handles: Evidence pattern matching, fallback injection analysis
|
|
225
|
+
*/
|
|
226
|
+
private checkVulnerabilityEvidence;
|
|
227
|
+
/**
|
|
228
|
+
* Analyze injection response (fallback logic)
|
|
192
229
|
*/
|
|
193
|
-
private
|
|
230
|
+
private analyzeInjectionResponse;
|
|
194
231
|
}
|
|
195
232
|
//# sourceMappingURL=SecurityResponseAnalyzer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityResponseAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityResponseAnalyzer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SecurityResponseAnalyzer.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityResponseAnalyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,2BAA2B,EAC3B,IAAI,EACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,C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