@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
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Pattern Library
|
|
3
|
+
* Single source of truth for all regex patterns used in security analysis
|
|
4
|
+
*
|
|
5
|
+
* Extracted from SecurityResponseAnalyzer.ts (Issue #53)
|
|
6
|
+
* Consolidates 16 pattern collections, eliminates duplicates
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Patterns to detect HTTP error responses (4xx/5xx)
|
|
10
|
+
* Used by: isHttpErrorResponse(), analyzeComputedMathResult()
|
|
11
|
+
*/
|
|
12
|
+
export declare const HTTP_ERROR_PATTERNS: {
|
|
13
|
+
/** Full pattern: status code + context (e.g., "404 not found") */
|
|
14
|
+
readonly statusWithContext: RegExp;
|
|
15
|
+
/** Simple pattern: status code at start (e.g., "404: ...") */
|
|
16
|
+
readonly statusAtStart: RegExp;
|
|
17
|
+
/** Short "not found" responses */
|
|
18
|
+
readonly notFound: RegExp;
|
|
19
|
+
/** JSON status field pattern */
|
|
20
|
+
readonly jsonStatus: RegExp;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Patterns for MCP protocol validation errors
|
|
24
|
+
* These indicate proper input rejection (SAFE behavior)
|
|
25
|
+
* Used by: isMCPValidationError()
|
|
26
|
+
*/
|
|
27
|
+
export declare const VALIDATION_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
28
|
+
/**
|
|
29
|
+
* Patterns indicating actual code/command execution
|
|
30
|
+
* Used by: hasExecutionEvidence()
|
|
31
|
+
*/
|
|
32
|
+
export declare const EXECUTION_INDICATORS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
33
|
+
/**
|
|
34
|
+
* Patterns for detecting execution artifacts in response
|
|
35
|
+
* Used by: detectExecutionArtifacts()
|
|
36
|
+
*/
|
|
37
|
+
export declare const EXECUTION_ARTIFACT_PATTERNS: {
|
|
38
|
+
/** Always indicates execution */
|
|
39
|
+
readonly alwaysExecution: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
40
|
+
/** Context-sensitive - only count if no echoed payload */
|
|
41
|
+
readonly contextSensitive: readonly [RegExp, RegExp, RegExp];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Patterns for connection/server errors
|
|
45
|
+
* Used by: isConnectionError(), isConnectionErrorFromException()
|
|
46
|
+
*/
|
|
47
|
+
export declare const CONNECTION_ERROR_PATTERNS: {
|
|
48
|
+
/** Unambiguous connection errors */
|
|
49
|
+
readonly unambiguous: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
50
|
+
/** Only apply when response starts with MCP error prefix */
|
|
51
|
+
readonly contextual: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
52
|
+
/** MCP error prefix pattern */
|
|
53
|
+
readonly mcpPrefix: RegExp;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Patterns for error classification
|
|
57
|
+
* Used by: classifyError(), classifyErrorFromException()
|
|
58
|
+
*/
|
|
59
|
+
export declare const ERROR_CLASSIFICATION_PATTERNS: {
|
|
60
|
+
readonly connection: RegExp;
|
|
61
|
+
readonly server: RegExp;
|
|
62
|
+
readonly protocol: RegExp;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Status patterns indicating safe response handling
|
|
66
|
+
* Used by: isReflectionResponse()
|
|
67
|
+
*/
|
|
68
|
+
export declare const STATUS_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
69
|
+
/**
|
|
70
|
+
* Reflection patterns indicating safe data handling
|
|
71
|
+
* Used by: isReflectionResponse()
|
|
72
|
+
*/
|
|
73
|
+
export declare const REFLECTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
74
|
+
/**
|
|
75
|
+
* Fail-open authentication patterns (VULNERABLE)
|
|
76
|
+
* Used by: analyzeAuthBypassResponse()
|
|
77
|
+
*/
|
|
78
|
+
export declare const AUTH_FAIL_OPEN_PATTERNS: readonly [{
|
|
79
|
+
readonly pattern: RegExp;
|
|
80
|
+
readonly evidence: "auth_type: fail-open (CVE-2025-52882)";
|
|
81
|
+
}, {
|
|
82
|
+
readonly pattern: RegExp;
|
|
83
|
+
readonly evidence: "auth_status: bypassed";
|
|
84
|
+
}, {
|
|
85
|
+
readonly pattern: RegExp;
|
|
86
|
+
readonly evidence: "access granted despite failure";
|
|
87
|
+
}, {
|
|
88
|
+
readonly pattern: RegExp;
|
|
89
|
+
readonly evidence: "authentication skipped";
|
|
90
|
+
}, {
|
|
91
|
+
readonly pattern: RegExp;
|
|
92
|
+
readonly evidence: "fail-open pattern detected";
|
|
93
|
+
}, {
|
|
94
|
+
readonly pattern: RegExp;
|
|
95
|
+
readonly evidence: "auth bypassed";
|
|
96
|
+
}, {
|
|
97
|
+
readonly pattern: RegExp;
|
|
98
|
+
readonly evidence: "authentication bypassed";
|
|
99
|
+
}, {
|
|
100
|
+
readonly pattern: RegExp;
|
|
101
|
+
readonly evidence: "vulnerable flag with auth context";
|
|
102
|
+
}, {
|
|
103
|
+
readonly pattern: RegExp;
|
|
104
|
+
readonly evidence: "auth succeeded with null token";
|
|
105
|
+
}, {
|
|
106
|
+
readonly pattern: RegExp;
|
|
107
|
+
readonly evidence: "granted without valid token";
|
|
108
|
+
}, {
|
|
109
|
+
readonly pattern: RegExp;
|
|
110
|
+
readonly evidence: "action performed indicator";
|
|
111
|
+
}];
|
|
112
|
+
/**
|
|
113
|
+
* Fail-closed authentication patterns (SAFE)
|
|
114
|
+
* Used by: analyzeAuthBypassResponse()
|
|
115
|
+
*/
|
|
116
|
+
export declare const AUTH_FAIL_CLOSED_PATTERNS: readonly [{
|
|
117
|
+
readonly pattern: RegExp;
|
|
118
|
+
readonly evidence: "auth_type: fail-closed (secure)";
|
|
119
|
+
}, {
|
|
120
|
+
readonly pattern: RegExp;
|
|
121
|
+
readonly evidence: "auth_status: denied";
|
|
122
|
+
}, {
|
|
123
|
+
readonly pattern: RegExp;
|
|
124
|
+
readonly evidence: "access denied";
|
|
125
|
+
}, {
|
|
126
|
+
readonly pattern: RegExp;
|
|
127
|
+
readonly evidence: "authentication failed";
|
|
128
|
+
}, {
|
|
129
|
+
readonly pattern: RegExp;
|
|
130
|
+
readonly evidence: "fail-closed pattern detected";
|
|
131
|
+
}, {
|
|
132
|
+
readonly pattern: RegExp;
|
|
133
|
+
readonly evidence: "status: blocked";
|
|
134
|
+
}, {
|
|
135
|
+
readonly pattern: RegExp;
|
|
136
|
+
readonly evidence: "invalid token rejection";
|
|
137
|
+
}, {
|
|
138
|
+
readonly pattern: RegExp;
|
|
139
|
+
readonly evidence: "token required";
|
|
140
|
+
}, {
|
|
141
|
+
readonly pattern: RegExp;
|
|
142
|
+
readonly evidence: "unauthorized response";
|
|
143
|
+
}, {
|
|
144
|
+
readonly pattern: RegExp;
|
|
145
|
+
readonly evidence: "denial reason provided";
|
|
146
|
+
}];
|
|
147
|
+
/**
|
|
148
|
+
* Patterns indicating vulnerable shared state authorization
|
|
149
|
+
* Detects cross-tool privilege escalation via shared mutable state
|
|
150
|
+
* Used by: analyzeStateBasedAuthBypass()
|
|
151
|
+
*/
|
|
152
|
+
export declare const STATE_AUTH_VULNERABLE_PATTERNS: readonly [{
|
|
153
|
+
readonly pattern: RegExp;
|
|
154
|
+
readonly evidence: "admin_mode enabled in response";
|
|
155
|
+
}, {
|
|
156
|
+
readonly pattern: RegExp;
|
|
157
|
+
readonly evidence: "Tool hints at cross-tool state dependency";
|
|
158
|
+
}, {
|
|
159
|
+
readonly pattern: RegExp;
|
|
160
|
+
readonly evidence: "Explicit cross-tool state dependency";
|
|
161
|
+
}, {
|
|
162
|
+
readonly pattern: RegExp;
|
|
163
|
+
readonly evidence: "Cross-tool privilege escalation detected";
|
|
164
|
+
}, {
|
|
165
|
+
readonly pattern: RegExp;
|
|
166
|
+
readonly evidence: "Elevated privileges granted";
|
|
167
|
+
}, {
|
|
168
|
+
readonly pattern: RegExp;
|
|
169
|
+
readonly evidence: "Admin mode activated (state modifier)";
|
|
170
|
+
}, {
|
|
171
|
+
readonly pattern: RegExp;
|
|
172
|
+
readonly evidence: "Response hints at config_modifier for admin_mode";
|
|
173
|
+
}, {
|
|
174
|
+
readonly pattern: RegExp;
|
|
175
|
+
readonly evidence: "Tool depends on config_modifier for authorization";
|
|
176
|
+
}];
|
|
177
|
+
/**
|
|
178
|
+
* Patterns indicating safe independent authorization
|
|
179
|
+
* Detects tools that use per-request authentication (secure)
|
|
180
|
+
* Used by: analyzeStateBasedAuthBypass()
|
|
181
|
+
*/
|
|
182
|
+
export declare const STATE_AUTH_SAFE_PATTERNS: readonly [{
|
|
183
|
+
readonly pattern: RegExp;
|
|
184
|
+
readonly evidence: "Tool explicitly states it doesn't use shared state";
|
|
185
|
+
}, {
|
|
186
|
+
readonly pattern: RegExp;
|
|
187
|
+
readonly evidence: "Tool requires independent per-request auth";
|
|
188
|
+
}, {
|
|
189
|
+
readonly pattern: RegExp;
|
|
190
|
+
readonly evidence: "Independent authorization required";
|
|
191
|
+
}, {
|
|
192
|
+
readonly pattern: RegExp;
|
|
193
|
+
readonly evidence: "Tool confirms it does not use shared state";
|
|
194
|
+
}, {
|
|
195
|
+
readonly pattern: RegExp;
|
|
196
|
+
readonly evidence: "Request stored for admin review (no auto-execution)";
|
|
197
|
+
}, {
|
|
198
|
+
readonly pattern: RegExp;
|
|
199
|
+
readonly evidence: "Per-request authentication enforced";
|
|
200
|
+
}];
|
|
201
|
+
/**
|
|
202
|
+
* Response pattern structure for chain exploitation analysis
|
|
203
|
+
*/
|
|
204
|
+
export interface ChainResponsePattern {
|
|
205
|
+
pattern: RegExp;
|
|
206
|
+
weight: number;
|
|
207
|
+
category: string;
|
|
208
|
+
description: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Patterns indicating vulnerable chain execution behavior
|
|
212
|
+
* - Arbitrary tool invocation without allowlist
|
|
213
|
+
* - Output injection via template substitution
|
|
214
|
+
* - Recursive/circular chain execution
|
|
215
|
+
* - Missing depth limits
|
|
216
|
+
* - State poisoning between steps
|
|
217
|
+
*
|
|
218
|
+
* Used by: analyzeChainExploitation()
|
|
219
|
+
*/
|
|
220
|
+
export declare const CHAIN_EXPLOIT_VULNERABLE_PATTERNS: ChainResponsePattern[];
|
|
221
|
+
/**
|
|
222
|
+
* Patterns indicating safe/hardened chain handling
|
|
223
|
+
* - Tool allowlist validation
|
|
224
|
+
* - No execution (validation only)
|
|
225
|
+
* - Depth limits enforced
|
|
226
|
+
* - Output injection blocked
|
|
227
|
+
*
|
|
228
|
+
* Used by: analyzeChainExploitation()
|
|
229
|
+
*/
|
|
230
|
+
/**
|
|
231
|
+
* Threshold for confirming vulnerable chain execution behavior.
|
|
232
|
+
* Value of 1.5 requires ~2 weighted pattern matches to confirm vulnerability.
|
|
233
|
+
*
|
|
234
|
+
* Derived from A/B testing against vulnerable-mcp/hardened-mcp testbed:
|
|
235
|
+
* - vulnerable-mcp: typical scores 2.0-4.0 for vulnerable chains
|
|
236
|
+
* - hardened-mcp: typical scores 0.0-0.8 for safe chains
|
|
237
|
+
*
|
|
238
|
+
* Setting at 1.5 provides margin against false positives while
|
|
239
|
+
* maintaining detection of genuine vulnerabilities.
|
|
240
|
+
*/
|
|
241
|
+
export declare const CHAIN_VULNERABLE_THRESHOLD = 1.5;
|
|
242
|
+
/**
|
|
243
|
+
* Threshold for confirming safe/hardened chain behavior.
|
|
244
|
+
* Value of 1.0 requires 1+ weighted safe pattern matches.
|
|
245
|
+
*
|
|
246
|
+
* Derived from A/B testing:
|
|
247
|
+
* - hardened-mcp: typical scores 1.5-3.0 for safe chains
|
|
248
|
+
* - vulnerable-mcp: typical scores 0.0-0.5 for safe patterns
|
|
249
|
+
*/
|
|
250
|
+
export declare const CHAIN_SAFE_THRESHOLD = 1;
|
|
251
|
+
/**
|
|
252
|
+
* Maps vulnerability categories to detection patterns.
|
|
253
|
+
* Used by analyzeChainExploitation() for category classification.
|
|
254
|
+
*
|
|
255
|
+
* Extracted from inline patterns to maintain single source of truth.
|
|
256
|
+
*/
|
|
257
|
+
export declare const CHAIN_CATEGORY_PATTERNS: Record<string, {
|
|
258
|
+
pattern: RegExp;
|
|
259
|
+
category: string;
|
|
260
|
+
}[]>;
|
|
261
|
+
/**
|
|
262
|
+
* Detect vulnerability categories from response text.
|
|
263
|
+
* Returns array of detected category names.
|
|
264
|
+
*/
|
|
265
|
+
export declare function detectVulnerabilityCategories(responseText: string): string[];
|
|
266
|
+
export declare const CHAIN_EXPLOIT_SAFE_PATTERNS: ChainResponsePattern[];
|
|
267
|
+
/**
|
|
268
|
+
* Patterns indicating search result responses
|
|
269
|
+
* Used by: isSearchResultResponse()
|
|
270
|
+
*/
|
|
271
|
+
export declare const SEARCH_RESULT_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
272
|
+
/**
|
|
273
|
+
* Patterns indicating creation/modification responses
|
|
274
|
+
* Used by: isCreationResponse()
|
|
275
|
+
*/
|
|
276
|
+
export declare const CREATION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
277
|
+
/**
|
|
278
|
+
* Patterns for echoed injection payloads
|
|
279
|
+
* Used by: containsEchoedInjectionPayload()
|
|
280
|
+
*/
|
|
281
|
+
export declare const ECHOED_PAYLOAD_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
282
|
+
/**
|
|
283
|
+
* Fallback execution detection patterns
|
|
284
|
+
* Used by: analyzeInjectionResponse()
|
|
285
|
+
*/
|
|
286
|
+
export declare const FALLBACK_EXECUTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
287
|
+
/**
|
|
288
|
+
* Text-based validation rejection patterns
|
|
289
|
+
* Used by: isValidationRejection()
|
|
290
|
+
*/
|
|
291
|
+
export declare const TEXT_REJECTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
292
|
+
/**
|
|
293
|
+
* Result field rejection patterns (for JSON responses)
|
|
294
|
+
* Used by: isValidationRejection()
|
|
295
|
+
*/
|
|
296
|
+
export declare const RESULT_REJECTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
297
|
+
/**
|
|
298
|
+
* Ambiguous validation pattern strings (for confidence calculation)
|
|
299
|
+
* Used by: isValidationPattern()
|
|
300
|
+
*/
|
|
301
|
+
export declare const AMBIGUOUS_VALIDATION_PATTERNS: readonly ["type.*error", "invalid.*type", "error", "invalid", "failed", "negative.*not.*allowed", "must.*be.*positive", "invalid.*value", "overflow", "out.*of.*range"];
|
|
302
|
+
/**
|
|
303
|
+
* Patterns for identifying structured data tools
|
|
304
|
+
* Used by: isStructuredDataTool()
|
|
305
|
+
*/
|
|
306
|
+
export declare const DATA_TOOL_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
307
|
+
/**
|
|
308
|
+
* Read-only tool name patterns
|
|
309
|
+
* Used by: analyzeComputedMathResult()
|
|
310
|
+
*/
|
|
311
|
+
export declare const READ_ONLY_TOOL_NAME_PATTERN: RegExp;
|
|
312
|
+
/**
|
|
313
|
+
* Simple math expression pattern
|
|
314
|
+
* Used by: isComputedMathResult(), analyzeComputedMathResult()
|
|
315
|
+
*/
|
|
316
|
+
export declare const SIMPLE_MATH_PATTERN: RegExp;
|
|
317
|
+
/**
|
|
318
|
+
* Computational language indicators
|
|
319
|
+
* Used by: analyzeComputedMathResult()
|
|
320
|
+
*/
|
|
321
|
+
export declare const COMPUTATIONAL_INDICATORS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
322
|
+
/**
|
|
323
|
+
* Common data field names that often contain numeric values
|
|
324
|
+
* Used by: isCoincidentalNumericInStructuredData()
|
|
325
|
+
*/
|
|
326
|
+
export declare const STRUCTURED_DATA_FIELD_NAMES: readonly ["count", "total", "records", "page", "limit", "offset", "id", "status", "code", "version", "index", "size", "employees", "items", "results", "entries", "length", "pages", "rows", "columns", "width", "height", "timestamp", "duration", "amount", "price", "quantity"];
|
|
327
|
+
/**
|
|
328
|
+
* Structured data indicators for confidence calculation
|
|
329
|
+
* Used by: calculateConfidence()
|
|
330
|
+
*/
|
|
331
|
+
export declare const STRUCTURED_DATA_INDICATORS: {
|
|
332
|
+
readonly fieldPatterns: RegExp;
|
|
333
|
+
readonly bulletPattern: RegExp;
|
|
334
|
+
readonly jsonPattern: RegExp;
|
|
335
|
+
readonly numericMetadataPattern: RegExp;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Check if any pattern in array matches text
|
|
339
|
+
*/
|
|
340
|
+
export declare function matchesAny(patterns: readonly RegExp[], text: string): boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Check if HTTP error pattern matches
|
|
343
|
+
*/
|
|
344
|
+
export declare function isHttpError(text: string): boolean;
|
|
345
|
+
/**
|
|
346
|
+
* Check if response has MCP error prefix
|
|
347
|
+
*/
|
|
348
|
+
export declare function hasMcpErrorPrefix(text: string): boolean;
|
|
349
|
+
//# sourceMappingURL=SecurityPatternLibrary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityPatternLibrary.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityPatternLibrary.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAIlE,8DAA8D;;IAG9D,kCAAkC;;IAGlC,gCAAgC;;CAExB,CAAC;AAMX;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,2JAmB5B,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,oBAAoB,2LAuBvB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,2BAA2B;IACtC,iCAAiC;;IAejC,0DAA0D;;CAElD,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,yBAAyB;IACpC,oCAAoC;;IAqBpC,4DAA4D;;IAW5D,+BAA+B;;CAEvB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;CAMhC,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,eAAe,mJAkBlB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mBAAmB,2rBAwGtB,CAAC;AAMX;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B1B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc5B,CAAC;AAMX;;;;GAIG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