@bryan-thompson/inspector-assessment-client 1.26.4 → 1.26.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/assets/{OAuthCallback-DRmaIku9.js → OAuthCallback-CCWVtjr7.js} +1 -1
  2. package/dist/assets/{OAuthDebugCallback-BU8UZdx8.js → OAuthDebugCallback-DqbXfUi4.js} +1 -1
  3. package/dist/assets/{index-Dd4pL57l.js → index-CsDJSSWq.js} +4 -4
  4. package/dist/index.html +1 -1
  5. package/lib/lib/securityPatterns.d.ts.map +1 -1
  6. package/lib/lib/securityPatterns.js +26 -0
  7. package/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts +57 -0
  8. package/lib/services/assessment/modules/securityTests/ConfidenceScorer.d.ts.map +1 -0
  9. package/lib/services/assessment/modules/securityTests/ConfidenceScorer.js +199 -0
  10. package/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts +57 -0
  11. package/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts.map +1 -0
  12. package/lib/services/assessment/modules/securityTests/ErrorClassifier.js +113 -0
  13. package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts +49 -0
  14. package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.d.ts.map +1 -0
  15. package/lib/services/assessment/modules/securityTests/ExecutionArtifactDetector.js +74 -0
  16. package/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts +58 -0
  17. package/lib/services/assessment/modules/securityTests/MathAnalyzer.d.ts.map +1 -0
  18. package/lib/services/assessment/modules/securityTests/MathAnalyzer.js +251 -0
  19. package/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts +59 -0
  20. package/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts.map +1 -0
  21. package/lib/services/assessment/modules/securityTests/SafeResponseDetector.js +151 -0
  22. package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +229 -0
  23. package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -0
  24. package/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +566 -0
  25. package/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.d.ts.map +1 -1
  26. package/lib/services/assessment/modules/securityTests/SecurityPayloadGenerator.js +49 -1
  27. package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +63 -85
  28. package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
  29. package/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +270 -1159
  30. package/package.json +1 -1
@@ -0,0 +1,229 @@
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 search result responses
149
+ * Used by: isSearchResultResponse()
150
+ */
151
+ export declare const SEARCH_RESULT_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
152
+ /**
153
+ * Patterns indicating creation/modification responses
154
+ * Used by: isCreationResponse()
155
+ */
156
+ export declare const CREATION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
157
+ /**
158
+ * Patterns for echoed injection payloads
159
+ * Used by: containsEchoedInjectionPayload()
160
+ */
161
+ export declare const ECHOED_PAYLOAD_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
162
+ /**
163
+ * Fallback execution detection patterns
164
+ * Used by: analyzeInjectionResponse()
165
+ */
166
+ export declare const FALLBACK_EXECUTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp];
167
+ /**
168
+ * Text-based validation rejection patterns
169
+ * Used by: isValidationRejection()
170
+ */
171
+ export declare const TEXT_REJECTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
172
+ /**
173
+ * Result field rejection patterns (for JSON responses)
174
+ * Used by: isValidationRejection()
175
+ */
176
+ export declare const RESULT_REJECTION_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
177
+ /**
178
+ * Ambiguous validation pattern strings (for confidence calculation)
179
+ * Used by: isValidationPattern()
180
+ */
181
+ 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"];
182
+ /**
183
+ * Patterns for identifying structured data tools
184
+ * Used by: isStructuredDataTool()
185
+ */
186
+ export declare const DATA_TOOL_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
187
+ /**
188
+ * Read-only tool name patterns
189
+ * Used by: analyzeComputedMathResult()
190
+ */
191
+ export declare const READ_ONLY_TOOL_NAME_PATTERN: RegExp;
192
+ /**
193
+ * Simple math expression pattern
194
+ * Used by: isComputedMathResult(), analyzeComputedMathResult()
195
+ */
196
+ export declare const SIMPLE_MATH_PATTERN: RegExp;
197
+ /**
198
+ * Computational language indicators
199
+ * Used by: analyzeComputedMathResult()
200
+ */
201
+ export declare const COMPUTATIONAL_INDICATORS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
202
+ /**
203
+ * Common data field names that often contain numeric values
204
+ * Used by: isCoincidentalNumericInStructuredData()
205
+ */
206
+ 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"];
207
+ /**
208
+ * Structured data indicators for confidence calculation
209
+ * Used by: calculateConfidence()
210
+ */
211
+ export declare const STRUCTURED_DATA_INDICATORS: {
212
+ readonly fieldPatterns: RegExp;
213
+ readonly bulletPattern: RegExp;
214
+ readonly jsonPattern: RegExp;
215
+ readonly numericMetadataPattern: RegExp;
216
+ };
217
+ /**
218
+ * Check if any pattern in array matches text
219
+ */
220
+ export declare function matchesAny(patterns: readonly RegExp[], text: string): boolean;
221
+ /**
222
+ * Check if HTTP error pattern matches
223
+ */
224
+ export declare function isHttpError(text: string): boolean;
225
+ /**
226
+ * Check if response has MCP error prefix
227
+ */
228
+ export declare function hasMcpErrorPrefix(text: string): boolean;
229
+ //# 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,MA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