@bryan-thompson/inspector-assessment 1.36.5 → 1.38.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/cli/build/lib/assessment-runner/assessment-executor.js +40 -0
- package/cli/build/lib/assessment-runner/source-loader.js +11 -0
- package/cli/package.json +1 -1
- package/client/dist/assets/{OAuthCallback-DJ1av7om.js → OAuthCallback-AngeBaCl.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-lRXgX7wV.js → OAuthDebugCallback--FE6_fPs.js} +1 -1
- package/client/dist/assets/{index-DEdS99fp.js → index-BQC95Boo.js} +4 -4
- package/client/dist/index.html +1 -1
- package/client/lib/lib/assessment/coreTypes.d.ts +37 -0
- package/client/lib/lib/assessment/coreTypes.d.ts.map +1 -1
- package/client/lib/lib/assessment/resultTypes.d.ts +30 -1
- package/client/lib/lib/assessment/resultTypes.d.ts.map +1 -1
- package/client/lib/lib/assessment/sharedSchemas.d.ts +10 -0
- package/client/lib/lib/assessment/sharedSchemas.d.ts.map +1 -1
- package/client/lib/lib/assessment/sharedSchemas.js +4 -0
- package/client/lib/lib/securityPatterns/advancedExploitPatterns.d.ts +13 -0
- package/client/lib/lib/securityPatterns/advancedExploitPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/advancedExploitPatterns.js +504 -0
- package/client/lib/lib/securityPatterns/authSessionPatterns.d.ts +12 -0
- package/client/lib/lib/securityPatterns/authSessionPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/authSessionPatterns.js +357 -0
- package/client/lib/lib/securityPatterns/index.d.ts +18 -0
- package/client/lib/lib/securityPatterns/index.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/index.js +18 -0
- package/client/lib/lib/securityPatterns/injectionPatterns.d.ts +13 -0
- package/client/lib/lib/securityPatterns/injectionPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/injectionPatterns.js +356 -0
- package/client/lib/lib/securityPatterns/resourceExhaustionPatterns.d.ts +12 -0
- package/client/lib/lib/securityPatterns/resourceExhaustionPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/resourceExhaustionPatterns.js +215 -0
- package/client/lib/lib/securityPatterns/toolSpecificPatterns.d.ts +13 -0
- package/client/lib/lib/securityPatterns/toolSpecificPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/toolSpecificPatterns.js +373 -0
- package/client/lib/lib/securityPatterns/types.d.ts +20 -0
- package/client/lib/lib/securityPatterns/types.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/types.js +6 -0
- package/client/lib/lib/securityPatterns/utils.d.ts +56 -0
- package/client/lib/lib/securityPatterns/utils.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/utils.js +96 -0
- package/client/lib/lib/securityPatterns/validationPatterns.d.ts +13 -0
- package/client/lib/lib/securityPatterns/validationPatterns.d.ts.map +1 -0
- package/client/lib/lib/securityPatterns/validationPatterns.js +110 -0
- package/client/lib/lib/securityPatterns.d.ts +18 -69
- package/client/lib/lib/securityPatterns.d.ts.map +1 -1
- package/client/lib/lib/securityPatterns.js +18 -1946
- package/client/lib/services/assessment/AssessmentOrchestrator.d.ts +6 -1
- package/client/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
- package/client/lib/services/assessment/config/performanceConfig.d.ts +18 -0
- package/client/lib/services/assessment/config/performanceConfig.d.ts.map +1 -1
- package/client/lib/services/assessment/config/performanceConfig.js +6 -0
- package/client/lib/services/assessment/config/performanceConfigSchemas.d.ts +18 -0
- package/client/lib/services/assessment/config/performanceConfigSchemas.d.ts.map +1 -1
- package/client/lib/services/assessment/config/performanceConfigSchemas.js +20 -0
- package/client/lib/services/assessment/helpers/ExternalAPIDependencyDetector.d.ts +165 -0
- package/client/lib/services/assessment/helpers/ExternalAPIDependencyDetector.d.ts.map +1 -0
- package/client/lib/services/assessment/helpers/ExternalAPIDependencyDetector.js +317 -0
- package/client/lib/services/assessment/helpers/StdioTransportDetector.d.ts +137 -0
- package/client/lib/services/assessment/helpers/StdioTransportDetector.d.ts.map +1 -0
- package/client/lib/services/assessment/helpers/StdioTransportDetector.js +315 -0
- package/client/lib/services/assessment/helpers/ToolAnnotationExtractor.d.ts +34 -0
- package/client/lib/services/assessment/helpers/ToolAnnotationExtractor.d.ts.map +1 -0
- package/client/lib/services/assessment/helpers/ToolAnnotationExtractor.js +85 -0
- package/client/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts +23 -0
- package/client/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ErrorHandlingAssessor.js +255 -20
- package/client/lib/services/assessment/modules/FunctionalityAssessor.d.ts +10 -0
- package/client/lib/services/assessment/modules/FunctionalityAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/FunctionalityAssessor.js +65 -3
- package/client/lib/services/assessment/modules/ProtocolComplianceAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/ProtocolComplianceAssessor.js +30 -0
- package/client/lib/services/assessment/modules/SecurityAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/SecurityAssessor.js +6 -0
- package/client/lib/services/assessment/modules/TemporalAssessor.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/TemporalAssessor.js +16 -3
- package/client/lib/services/assessment/modules/annotations/AlignmentChecker.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/annotations/AlignmentChecker.js +6 -2
- package/client/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/annotations/DescriptionPoisoningDetector.js +16 -7
- package/client/lib/services/assessment/modules/securityTests/AnnotationAwareSeverity.d.ts +55 -0
- package/client/lib/services/assessment/modules/securityTests/AnnotationAwareSeverity.d.ts.map +1 -0
- package/client/lib/services/assessment/modules/securityTests/AnnotationAwareSeverity.js +135 -0
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts +14 -0
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/ErrorClassifier.js +24 -1
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts +6 -0
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SafeResponseDetector.js +9 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts +43 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPatternLibrary.js +87 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPayloadTester.d.ts +39 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPayloadTester.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityPayloadTester.js +93 -3
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/SecurityResponseAnalyzer.js +10 -1
- package/client/lib/services/assessment/modules/securityTests/index.d.ts +1 -0
- package/client/lib/services/assessment/modules/securityTests/index.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/securityTests/index.js +1 -0
- package/client/lib/services/assessment/modules/temporal/VarianceClassifier.d.ts +16 -1
- package/client/lib/services/assessment/modules/temporal/VarianceClassifier.d.ts.map +1 -1
- package/client/lib/services/assessment/modules/temporal/VarianceClassifier.js +43 -1
- package/client/package.json +1 -1
- package/package.json +1 -1
- package/server/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Validation and Protocol Compliance Patterns
|
|
3
|
+
*
|
|
4
|
+
* Tests for input validation and MCP protocol compliance.
|
|
5
|
+
* Includes: Type Safety, Boundary Testing, Required Fields,
|
|
6
|
+
* MCP Error Format, Timeout Handling
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Input validation and protocol compliance patterns (5 patterns)
|
|
10
|
+
*/
|
|
11
|
+
export const VALIDATION_PATTERNS = [
|
|
12
|
+
// 7. TYPE SAFETY
|
|
13
|
+
{
|
|
14
|
+
attackName: "Type Safety",
|
|
15
|
+
description: "Test if tool validates parameter types correctly",
|
|
16
|
+
payloads: [
|
|
17
|
+
{
|
|
18
|
+
payload: "not_a_number",
|
|
19
|
+
evidence: /(type.*error|invalid.*type|expected.*number|cannot.*convert)/i,
|
|
20
|
+
riskLevel: "MEDIUM",
|
|
21
|
+
description: "String instead of number",
|
|
22
|
+
payloadType: "validation",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
payload: "999999999999999",
|
|
26
|
+
evidence: /(overflow|out.*of.*range|exceeds.*maximum|number.*too.*large)/i,
|
|
27
|
+
riskLevel: "MEDIUM",
|
|
28
|
+
description: "Numeric overflow",
|
|
29
|
+
payloadType: "validation",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
payload: "true",
|
|
33
|
+
evidence: /(type.*error|invalid.*type|expected.*string|cannot.*convert)/i,
|
|
34
|
+
riskLevel: "LOW",
|
|
35
|
+
description: "Boolean instead of string",
|
|
36
|
+
payloadType: "validation",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
// 8. BOUNDARY TESTING
|
|
41
|
+
{
|
|
42
|
+
attackName: "Boundary Testing",
|
|
43
|
+
description: "Test edge cases and boundary conditions",
|
|
44
|
+
payloads: [
|
|
45
|
+
{
|
|
46
|
+
payload: "",
|
|
47
|
+
evidence: /(empty.*not.*allowed|required|cannot.*be.*empty|must.*not.*be.*empty)/i,
|
|
48
|
+
riskLevel: "LOW",
|
|
49
|
+
description: "Empty string validation",
|
|
50
|
+
payloadType: "validation",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
payload: "A".repeat(10000),
|
|
54
|
+
evidence: /(too.*long|exceeds.*length|maximum.*length|length.*limit)/i,
|
|
55
|
+
riskLevel: "MEDIUM",
|
|
56
|
+
description: "Maximum length validation",
|
|
57
|
+
payloadType: "validation",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
payload: "-1",
|
|
61
|
+
evidence: /(negative.*not.*allowed|must.*be.*positive|invalid.*value)/i,
|
|
62
|
+
riskLevel: "LOW",
|
|
63
|
+
description: "Negative number validation",
|
|
64
|
+
payloadType: "validation",
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
// 9. REQUIRED FIELDS
|
|
69
|
+
{
|
|
70
|
+
attackName: "Required Fields",
|
|
71
|
+
description: "Test if tool validates required parameters",
|
|
72
|
+
payloads: [
|
|
73
|
+
{
|
|
74
|
+
payload: "MISSING_REQUIRED",
|
|
75
|
+
evidence: /(required|missing.*parameter|field.*required|parameter.*required)/i,
|
|
76
|
+
riskLevel: "MEDIUM",
|
|
77
|
+
description: "Missing required fields",
|
|
78
|
+
payloadType: "validation",
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
// 10. MCP ERROR FORMAT
|
|
83
|
+
{
|
|
84
|
+
attackName: "MCP Error Format",
|
|
85
|
+
description: "Verify errors follow MCP protocol specification",
|
|
86
|
+
payloads: [
|
|
87
|
+
{
|
|
88
|
+
payload: "INVALID_TRIGGER_ERROR",
|
|
89
|
+
evidence: /(isError|error|invalid|failed)/i,
|
|
90
|
+
riskLevel: "LOW",
|
|
91
|
+
description: "Error response compliance check",
|
|
92
|
+
payloadType: "protocol",
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
// 11. TIMEOUT HANDLING
|
|
97
|
+
{
|
|
98
|
+
attackName: "Timeout Handling",
|
|
99
|
+
description: "Test if tool handles long operations gracefully",
|
|
100
|
+
payloads: [
|
|
101
|
+
{
|
|
102
|
+
payload: "SIMULATE_LONG_OPERATION",
|
|
103
|
+
evidence: /(timeout|timed.*out|exceeded.*time|operation.*timeout)/i,
|
|
104
|
+
riskLevel: "LOW",
|
|
105
|
+
description: "Operation timeout handling",
|
|
106
|
+
payloadType: "protocol",
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
];
|
|
@@ -1,77 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Backend API Security Patterns
|
|
3
|
-
* Tests MCP server API security with 30 focused patterns
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* - Input Validation (3 patterns): Type Safety, Boundary Testing, Required Fields
|
|
8
|
-
* - Protocol Compliance (2 patterns): MCP Error Format, Timeout Handling
|
|
9
|
-
* - Tool-Specific Vulnerabilities (10 patterns):
|
|
10
|
-
* - Indirect Injection, Unicode Bypass, Nested Injection, Package Squatting
|
|
11
|
-
* - Data Exfiltration, Configuration Drift, Tool Shadowing
|
|
12
|
-
* - Tool Output Injection (Issue #103, Challenge #8)
|
|
13
|
-
* - Secret Leakage (Issue #103, Challenge #9)
|
|
14
|
-
* - Blacklist Bypass (Issue #103, Challenge #11)
|
|
15
|
-
* - Resource Exhaustion (1 pattern): DoS/Resource Exhaustion
|
|
16
|
-
* - Deserialization (1 pattern): Insecure Deserialization
|
|
17
|
-
* - Token Theft (1 pattern): Authentication token leakage
|
|
18
|
-
* - Permission Scope (1 pattern): Privilege escalation and scope bypass
|
|
19
|
-
* - Auth Bypass (1 pattern): Fail-open authentication vulnerabilities (Issue #75)
|
|
20
|
-
* - Cross-Tool State Bypass (1 pattern): Cross-tool privilege escalation via shared state (Issue #92)
|
|
21
|
-
* - Chained Exploitation (1 pattern): Multi-tool chain execution attacks (Issue #93)
|
|
22
|
-
* - Session Management (1 pattern): Session fixation, predictable tokens, no timeout (Issue #111)
|
|
4
|
+
* @deprecated This file has been modularized into focused modules for better maintainability.
|
|
5
|
+
* All exports are re-exported from the new `securityPatterns/` directory for backward compatibility.
|
|
23
6
|
*
|
|
24
|
-
*
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
28
|
-
* -
|
|
7
|
+
* For new code, prefer importing from specific modules:
|
|
8
|
+
* - `@/lib/securityPatterns/types` - SecurityPayload, AttackPattern interfaces
|
|
9
|
+
* - `@/lib/securityPatterns/injectionPatterns` - Critical injection attacks
|
|
10
|
+
* - `@/lib/securityPatterns/validationPatterns` - Input validation and protocol
|
|
11
|
+
* - `@/lib/securityPatterns/toolSpecificPatterns` - Tool-specific vulnerabilities
|
|
12
|
+
* - `@/lib/securityPatterns/resourceExhaustionPatterns` - DoS and deserialization
|
|
13
|
+
* - `@/lib/securityPatterns/authSessionPatterns` - Auth and session management
|
|
14
|
+
* - `@/lib/securityPatterns/advancedExploitPatterns` - Advanced multi-step exploits
|
|
29
15
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
import { SecurityRiskLevel } from "./assessmentTypes.js";
|
|
36
|
-
export interface SecurityPayload {
|
|
37
|
-
payload: string;
|
|
38
|
-
evidence: RegExp;
|
|
39
|
-
riskLevel: SecurityRiskLevel;
|
|
40
|
-
description: string;
|
|
41
|
-
payloadType: string;
|
|
42
|
-
parameterTypes?: string[];
|
|
43
|
-
}
|
|
44
|
-
export interface AttackPattern {
|
|
45
|
-
attackName: string;
|
|
46
|
-
description: string;
|
|
47
|
-
payloads: SecurityPayload[];
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* ========================================
|
|
51
|
-
* BACKEND API SECURITY PATTERNS
|
|
52
|
-
* ========================================
|
|
16
|
+
* Or import everything from `@/lib/securityPatterns`:
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { SECURITY_ATTACK_PATTERNS, getPayloadsForAttack } from "../lib/securityPatterns.js";
|
|
19
|
+
* ```
|
|
53
20
|
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Get all payloads for an attack type
|
|
59
|
-
*/
|
|
60
|
-
export declare function getPayloadsForAttack(attackName: string, limit?: number): SecurityPayload[];
|
|
61
|
-
/**
|
|
62
|
-
* Get all attack patterns (for testing all tools)
|
|
63
|
-
*/
|
|
64
|
-
export declare function getAllAttackPatterns(): AttackPattern[];
|
|
65
|
-
/**
|
|
66
|
-
* Get pattern statistics
|
|
21
|
+
* See GitHub Issue #163 for details on this refactoring.
|
|
22
|
+
*
|
|
23
|
+
* @module securityPatterns
|
|
67
24
|
*/
|
|
68
|
-
export
|
|
69
|
-
totalAttackTypes: number;
|
|
70
|
-
totalPayloads: number;
|
|
71
|
-
highRiskPayloads: number;
|
|
72
|
-
mediumRiskPayloads: number;
|
|
73
|
-
lowRiskPayloads: number;
|
|
74
|
-
payloadTypeBreakdown: Record<string, number>;
|
|
75
|
-
averagePayloadsPerAttack: number;
|
|
76
|
-
};
|
|
25
|
+
export * from "./securityPatterns/index.js";
|
|
77
26
|
//# sourceMappingURL=securityPatterns.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,cAAc,0BAA0B,CAAC"}
|