mstro-app 0.3.7 → 0.3.8
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/README.md +4 -8
- package/bin/mstro.js +54 -15
- package/dist/server/cli/headless/stall-assessor.d.ts.map +1 -1
- package/dist/server/cli/headless/stall-assessor.js +4 -1
- package/dist/server/cli/headless/stall-assessor.js.map +1 -1
- package/dist/server/cli/headless/tool-watchdog.d.ts.map +1 -1
- package/dist/server/cli/headless/tool-watchdog.js +8 -0
- package/dist/server/cli/headless/tool-watchdog.js.map +1 -1
- package/dist/server/index.js +0 -4
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcp/bouncer-integration.d.ts +2 -0
- package/dist/server/mcp/bouncer-integration.d.ts.map +1 -1
- package/dist/server/mcp/bouncer-integration.js +55 -39
- package/dist/server/mcp/bouncer-integration.js.map +1 -1
- package/dist/server/mcp/bouncer-sandbox.d.ts +60 -0
- package/dist/server/mcp/bouncer-sandbox.d.ts.map +1 -0
- package/dist/server/mcp/bouncer-sandbox.js +182 -0
- package/dist/server/mcp/bouncer-sandbox.js.map +1 -0
- package/dist/server/mcp/security-patterns.d.ts +6 -12
- package/dist/server/mcp/security-patterns.d.ts.map +1 -1
- package/dist/server/mcp/security-patterns.js +197 -10
- package/dist/server/mcp/security-patterns.js.map +1 -1
- package/dist/server/services/websocket/handler.d.ts +0 -1
- package/dist/server/services/websocket/handler.d.ts.map +1 -1
- package/dist/server/services/websocket/handler.js +7 -2
- package/dist/server/services/websocket/handler.js.map +1 -1
- package/dist/server/services/websocket/quality-handlers.d.ts +4 -0
- package/dist/server/services/websocket/quality-handlers.d.ts.map +1 -0
- package/dist/server/services/websocket/quality-handlers.js +106 -0
- package/dist/server/services/websocket/quality-handlers.js.map +1 -0
- package/dist/server/services/websocket/quality-service.d.ts +54 -0
- package/dist/server/services/websocket/quality-service.d.ts.map +1 -0
- package/dist/server/services/websocket/quality-service.js +766 -0
- package/dist/server/services/websocket/quality-service.js.map +1 -0
- package/dist/server/services/websocket/session-handlers.d.ts.map +1 -1
- package/dist/server/services/websocket/session-handlers.js +23 -0
- package/dist/server/services/websocket/session-handlers.js.map +1 -1
- package/dist/server/services/websocket/types.d.ts +2 -2
- package/dist/server/services/websocket/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/server/cli/headless/stall-assessor.ts +4 -1
- package/server/cli/headless/tool-watchdog.ts +8 -0
- package/server/index.ts +0 -4
- package/server/mcp/bouncer-integration.ts +66 -44
- package/server/mcp/bouncer-sandbox.ts +214 -0
- package/server/mcp/security-patterns.ts +206 -10
- package/server/services/websocket/handler.ts +7 -2
- package/server/services/websocket/quality-handlers.ts +140 -0
- package/server/services/websocket/quality-service.ts +922 -0
- package/server/services/websocket/session-handlers.ts +26 -0
- package/server/services/websocket/types.ts +14 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface SandboxExecResult {
|
|
2
|
+
/** The sandboxed command that was actually run */
|
|
3
|
+
wrappedCommand: string;
|
|
4
|
+
/** Whether sandbox-runtime is available on this platform */
|
|
5
|
+
sandboxAvailable: boolean;
|
|
6
|
+
/** Whether the sandbox contained the operation (no violations) */
|
|
7
|
+
contained: boolean;
|
|
8
|
+
/** List of violation descriptions if any escaped the sandbox */
|
|
9
|
+
violations: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface CanaryCheckResult {
|
|
12
|
+
/** Whether the canary file still exists (should be true if sandbox contained the write) */
|
|
13
|
+
canaryIntact: boolean;
|
|
14
|
+
/** Whether a file was written outside the sandbox (should be false) */
|
|
15
|
+
escapeDetected: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Test harness that wraps command execution in sandbox-runtime.
|
|
19
|
+
* Provides canary files and violation tracking to verify containment.
|
|
20
|
+
*/
|
|
21
|
+
export declare class BouncerSandboxHarness {
|
|
22
|
+
private sandboxManager;
|
|
23
|
+
private sandboxAvailable;
|
|
24
|
+
private tempDir;
|
|
25
|
+
private canaryDir;
|
|
26
|
+
constructor();
|
|
27
|
+
/**
|
|
28
|
+
* Initialize the sandbox. Falls back gracefully if bwrap/sandbox-exec not available.
|
|
29
|
+
*/
|
|
30
|
+
initialize(): Promise<{
|
|
31
|
+
available: boolean;
|
|
32
|
+
reason?: string;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Execute a command inside the sandbox. Returns containment results.
|
|
36
|
+
* If sandbox is not available, validates the bouncer decision only (no actual execution).
|
|
37
|
+
*/
|
|
38
|
+
executeInSandbox(command: string): Promise<SandboxExecResult>;
|
|
39
|
+
/**
|
|
40
|
+
* Place a canary file and return a checker to verify containment.
|
|
41
|
+
* If a sandboxed command can delete or modify the canary, containment failed.
|
|
42
|
+
*/
|
|
43
|
+
placeCanary(name: string): {
|
|
44
|
+
path: string;
|
|
45
|
+
check: () => CanaryCheckResult;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Get the temp directory where sandboxed commands can write.
|
|
49
|
+
*/
|
|
50
|
+
getSandboxWriteDir(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the sandbox is actually available and initialized.
|
|
53
|
+
*/
|
|
54
|
+
isAvailable(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Clean up temp dirs and reset sandbox state.
|
|
57
|
+
*/
|
|
58
|
+
cleanup(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=bouncer-sandbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bouncer-sandbox.d.ts","sourceRoot":"","sources":["../../../server/mcp/bouncer-sandbox.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kEAAkE;IAClE,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,2FAA2F;IAC3F,YAAY,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,cAAc,CAA0F;IAChH,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,SAAS,CAAS;;IAQ1B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAiDpE;;;OAGG;IACG,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAmDnE;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,iBAAiB,CAAA;KAAE;IAc3E;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAI5B;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc/B"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
// Copyright (c) 2025-present Mstro, Inc. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License. See LICENSE file for details.
|
|
3
|
+
/**
|
|
4
|
+
* Sandbox Harness for Bouncer Testing
|
|
5
|
+
*
|
|
6
|
+
* Wraps command execution in Anthropic's sandbox-runtime (bubblewrap on Linux,
|
|
7
|
+
* sandbox-exec on macOS) to safely test what happens when the bouncer FAILS —
|
|
8
|
+
* i.e., when a malicious tool call gets through.
|
|
9
|
+
*
|
|
10
|
+
* Usage in tests:
|
|
11
|
+
* const harness = new BouncerSandboxHarness();
|
|
12
|
+
* await harness.initialize();
|
|
13
|
+
* const result = await harness.executeInSandbox('rm -rf /tmp/test-canary');
|
|
14
|
+
* expect(result.violations).toContain(...)
|
|
15
|
+
* await harness.cleanup();
|
|
16
|
+
*/
|
|
17
|
+
import { execSync } from 'node:child_process';
|
|
18
|
+
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
19
|
+
import { tmpdir } from 'node:os';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
/**
|
|
22
|
+
* Test harness that wraps command execution in sandbox-runtime.
|
|
23
|
+
* Provides canary files and violation tracking to verify containment.
|
|
24
|
+
*/
|
|
25
|
+
export class BouncerSandboxHarness {
|
|
26
|
+
sandboxManager = null;
|
|
27
|
+
sandboxAvailable = false;
|
|
28
|
+
tempDir;
|
|
29
|
+
canaryDir;
|
|
30
|
+
constructor() {
|
|
31
|
+
this.tempDir = mkdtempSync(join(tmpdir(), 'bouncer-sandbox-'));
|
|
32
|
+
this.canaryDir = join(this.tempDir, 'canaries');
|
|
33
|
+
mkdirSync(this.canaryDir, { recursive: true });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Initialize the sandbox. Falls back gracefully if bwrap/sandbox-exec not available.
|
|
37
|
+
*/
|
|
38
|
+
async initialize() {
|
|
39
|
+
try {
|
|
40
|
+
const { SandboxManager } = await import('@anthropic-ai/sandbox-runtime');
|
|
41
|
+
if (!SandboxManager.isSupportedPlatform()) {
|
|
42
|
+
return { available: false, reason: 'Platform not supported by sandbox-runtime' };
|
|
43
|
+
}
|
|
44
|
+
const deps = SandboxManager.checkDependencies();
|
|
45
|
+
if (deps.errors.length > 0) {
|
|
46
|
+
return {
|
|
47
|
+
available: false,
|
|
48
|
+
reason: `Missing dependencies: ${deps.errors.join(', ')}`,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
await SandboxManager.initialize({
|
|
52
|
+
network: {
|
|
53
|
+
allowedDomains: [], // Block ALL network access
|
|
54
|
+
deniedDomains: ['*'],
|
|
55
|
+
},
|
|
56
|
+
filesystem: {
|
|
57
|
+
denyRead: [
|
|
58
|
+
'/home/*/.ssh',
|
|
59
|
+
'/home/*/.aws',
|
|
60
|
+
'/home/*/.gnupg',
|
|
61
|
+
'/etc/shadow',
|
|
62
|
+
'/etc/passwd',
|
|
63
|
+
],
|
|
64
|
+
allowWrite: [this.tempDir], // Only allow writes to our temp dir
|
|
65
|
+
denyWrite: [
|
|
66
|
+
'/',
|
|
67
|
+
'/home',
|
|
68
|
+
'/etc',
|
|
69
|
+
'/usr',
|
|
70
|
+
'/var',
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
this.sandboxManager = SandboxManager;
|
|
75
|
+
this.sandboxAvailable = true;
|
|
76
|
+
return { available: true };
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
80
|
+
return { available: false, reason: `Failed to initialize sandbox: ${msg}` };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Execute a command inside the sandbox. Returns containment results.
|
|
85
|
+
* If sandbox is not available, validates the bouncer decision only (no actual execution).
|
|
86
|
+
*/
|
|
87
|
+
async executeInSandbox(command) {
|
|
88
|
+
if (!this.sandboxAvailable || !this.sandboxManager) {
|
|
89
|
+
return {
|
|
90
|
+
wrappedCommand: command,
|
|
91
|
+
sandboxAvailable: false,
|
|
92
|
+
contained: true,
|
|
93
|
+
violations: ['Sandbox not available — decision-only testing mode'],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const violations = [];
|
|
97
|
+
try {
|
|
98
|
+
const wrappedCommand = await this.sandboxManager.wrapWithSandbox(command);
|
|
99
|
+
// Execute the wrapped command and capture violations
|
|
100
|
+
try {
|
|
101
|
+
execSync(wrappedCommand, {
|
|
102
|
+
timeout: 5000,
|
|
103
|
+
stdio: 'pipe',
|
|
104
|
+
cwd: this.tempDir,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Command failure inside sandbox is expected for malicious ops
|
|
109
|
+
}
|
|
110
|
+
// Check violation store
|
|
111
|
+
const stderr = this.sandboxManager.annotateStderrWithSandboxFailures(command, '');
|
|
112
|
+
if (stderr) {
|
|
113
|
+
violations.push(stderr);
|
|
114
|
+
}
|
|
115
|
+
this.sandboxManager.cleanupAfterCommand();
|
|
116
|
+
return {
|
|
117
|
+
wrappedCommand,
|
|
118
|
+
sandboxAvailable: true,
|
|
119
|
+
contained: violations.length === 0,
|
|
120
|
+
violations,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
125
|
+
violations.push(`Sandbox execution error: ${msg}`);
|
|
126
|
+
return {
|
|
127
|
+
wrappedCommand: command,
|
|
128
|
+
sandboxAvailable: true,
|
|
129
|
+
contained: true, // Error means the command didn't execute
|
|
130
|
+
violations,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Place a canary file and return a checker to verify containment.
|
|
136
|
+
* If a sandboxed command can delete or modify the canary, containment failed.
|
|
137
|
+
*/
|
|
138
|
+
placeCanary(name) {
|
|
139
|
+
const canaryPath = join(this.canaryDir, name);
|
|
140
|
+
const escapePath = join(this.canaryDir, `${name}.escaped`);
|
|
141
|
+
writeFileSync(canaryPath, `canary-${Date.now()}`, 'utf-8');
|
|
142
|
+
return {
|
|
143
|
+
path: canaryPath,
|
|
144
|
+
check: () => ({
|
|
145
|
+
canaryIntact: existsSync(canaryPath),
|
|
146
|
+
escapeDetected: existsSync(escapePath),
|
|
147
|
+
}),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get the temp directory where sandboxed commands can write.
|
|
152
|
+
*/
|
|
153
|
+
getSandboxWriteDir() {
|
|
154
|
+
return this.tempDir;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Whether the sandbox is actually available and initialized.
|
|
158
|
+
*/
|
|
159
|
+
isAvailable() {
|
|
160
|
+
return this.sandboxAvailable;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Clean up temp dirs and reset sandbox state.
|
|
164
|
+
*/
|
|
165
|
+
async cleanup() {
|
|
166
|
+
try {
|
|
167
|
+
if (this.sandboxManager) {
|
|
168
|
+
await this.sandboxManager.reset();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
// Ignore cleanup errors
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
rmSync(this.tempDir, { recursive: true, force: true });
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// Ignore cleanup errors
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=bouncer-sandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bouncer-sandbox.js","sourceRoot":"","sources":["../../../server/mcp/bouncer-sandbox.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,gEAAgE;AAEhE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAoBjC;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACxB,cAAc,GAAqF,IAAI,CAAC;IACxG,gBAAgB,GAAG,KAAK,CAAC;IACzB,OAAO,CAAS;IAChB,SAAS,CAAS;IAE1B;QACE,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAA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C,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;QACD,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,wBAAwB;QAC1B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Security Patterns - Single Source of Truth
|
|
3
|
-
*
|
|
4
|
-
* Consolidated pattern definitions for fast-path security checks.
|
|
5
|
-
* All pattern-based security decisions use this module to avoid duplication.
|
|
6
|
-
*
|
|
7
|
-
* PHILOSOPHY:
|
|
8
|
-
* - Most operations should be evaluated by CONTEXT, not by path or extension
|
|
9
|
-
* - Only truly catastrophic operations (rm -rf /, fork bombs) are auto-denied
|
|
10
|
-
* - Sensitive operations (system paths, credentials) get AI review with context
|
|
11
|
-
* - The question is: "Does this operation make sense given user intent?"
|
|
12
|
-
*/
|
|
13
1
|
export interface SecurityPattern {
|
|
14
2
|
pattern: RegExp;
|
|
15
3
|
reason?: string;
|
|
@@ -50,6 +38,12 @@ export declare const NEEDS_AI_REVIEW: SecurityPattern[];
|
|
|
50
38
|
* Check if operation matches any pattern in array
|
|
51
39
|
*/
|
|
52
40
|
export declare function matchesPattern(operation: string, patterns: SecurityPattern[]): SecurityPattern | null;
|
|
41
|
+
/**
|
|
42
|
+
* Normalize file paths in Write/Edit/Read operations to resolve .. traversal.
|
|
43
|
+
* Prevents path traversal attacks like "Write: /home/user/../../etc/passwd"
|
|
44
|
+
* from matching safe home-directory patterns.
|
|
45
|
+
*/
|
|
46
|
+
export declare function normalizeOperation(operation: string): string;
|
|
53
47
|
export declare function requiresAIReview(operation: string): boolean;
|
|
54
48
|
/**
|
|
55
49
|
* Check if operation targets a sensitive path
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-patterns.d.ts","sourceRoot":"","sources":["../../../server/mcp/security-patterns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"security-patterns.d.ts","sourceRoot":"","sources":["../../../server/mcp/security-patterns.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,eAAe,EAiB5C,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAAe,EA0C7C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,eAAe,EAoC5C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,eAAe,EAqH5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,eAAe,GAAG,IAAI,CAOrG;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAgED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CA8C3D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAEzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG;IAC/C,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CA8DA"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
// Copyright (c) 2025-present Mstro, Inc. All rights reserved.
|
|
2
2
|
// Licensed under the MIT License. See LICENSE file for details.
|
|
3
|
+
/**
|
|
4
|
+
* Security Patterns - Single Source of Truth
|
|
5
|
+
*
|
|
6
|
+
* Consolidated pattern definitions for fast-path security checks.
|
|
7
|
+
* All pattern-based security decisions use this module to avoid duplication.
|
|
8
|
+
*
|
|
9
|
+
* PHILOSOPHY:
|
|
10
|
+
* - Most operations should be evaluated by CONTEXT, not by path or extension
|
|
11
|
+
* - Only truly catastrophic operations (rm -rf /, fork bombs) are auto-denied
|
|
12
|
+
* - Sensitive operations (system paths, credentials) get AI review with context
|
|
13
|
+
* - The question is: "Does this operation make sense given user intent?"
|
|
14
|
+
*/
|
|
15
|
+
import { resolve } from 'node:path';
|
|
3
16
|
/**
|
|
4
17
|
* Sensitive paths that require AI context review
|
|
5
18
|
* These aren't auto-denied - they need context analysis to determine intent
|
|
@@ -61,7 +74,16 @@ export const CRITICAL_THREATS = [
|
|
|
61
74
|
{
|
|
62
75
|
pattern: /chmod\s+000\s+\//i,
|
|
63
76
|
reason: 'Attempting to make system directories inaccessible'
|
|
64
|
-
}
|
|
77
|
+
},
|
|
78
|
+
// Reverse shells - never legitimate in a dev workflow
|
|
79
|
+
{
|
|
80
|
+
pattern: /\/dev\/tcp\//i,
|
|
81
|
+
reason: 'Reverse shell via /dev/tcp - classic backdoor technique'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
pattern: /\bnc\b.*-[elp].*\b\d+\b/i,
|
|
85
|
+
reason: 'Netcat listener/reverse shell - common backdoor technique'
|
|
86
|
+
},
|
|
65
87
|
// NOTE: curl|bash is NOT here - it goes to Haiku for context review
|
|
66
88
|
// The question is "did a bad actor inject this?" not "is curl|bash dangerous?"
|
|
67
89
|
];
|
|
@@ -126,12 +148,96 @@ export const NEEDS_AI_REVIEW = [
|
|
|
126
148
|
pattern: /rm\s+-rf/i,
|
|
127
149
|
reason: 'Recursive deletion - verify target matches user intent'
|
|
128
150
|
},
|
|
151
|
+
// Data exfiltration patterns — piping data to network tools
|
|
152
|
+
{
|
|
153
|
+
pattern: /\|\s*(nc|netcat|ncat)\b/i,
|
|
154
|
+
reason: 'Pipe to netcat - potential data exfiltration'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
pattern: /\bscp\b.*@/i,
|
|
158
|
+
reason: 'SCP to remote host - potential data exfiltration'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
pattern: /\|\s*curl\b/i,
|
|
162
|
+
reason: 'Pipe to curl - potential data exfiltration'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
pattern: /curl\b.*-d\s*@/i,
|
|
166
|
+
reason: 'Curl with file upload - potential data exfiltration'
|
|
167
|
+
},
|
|
129
168
|
// ALL Write/Edit operations that aren't to /tmp go through context review
|
|
130
169
|
// This is the key change: we review based on context, not blanket allow/deny
|
|
131
170
|
{
|
|
132
171
|
pattern: /^(Write|Edit):\s*(?!\/tmp\/|\/var\/tmp\/)/i,
|
|
133
172
|
reason: 'File modification - verify aligns with user request'
|
|
134
173
|
},
|
|
174
|
+
// Reverse shells and bind shells — network-connected interactive shells
|
|
175
|
+
{
|
|
176
|
+
pattern: /\/dev\/tcp\//i,
|
|
177
|
+
reason: 'Potential reverse shell via /dev/tcp'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
pattern: /\b(nc|netcat|ncat)\b.*-e\s/i,
|
|
181
|
+
reason: 'Netcat with -e flag - potential reverse shell'
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
pattern: /\bsocket\b.*\bconnect\b.*\b(dup2|subprocess|exec)\b/i,
|
|
185
|
+
reason: 'Programmatic reverse shell pattern (socket+connect+exec)'
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
pattern: /\bperl\b.*\bsocket\b.*\bexec\b/i,
|
|
189
|
+
reason: 'Perl reverse shell pattern'
|
|
190
|
+
},
|
|
191
|
+
// Encoded/obfuscated payloads piped to shell or eval
|
|
192
|
+
{
|
|
193
|
+
pattern: /\b(base64|base32)\b.*-d.*\|\s*(bash|sh)\b/i,
|
|
194
|
+
reason: 'Decoded payload piped to shell - obfuscated command execution'
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
pattern: /\\x[0-9a-f]{2}.*\|\s*(bash|sh)\b/i,
|
|
198
|
+
reason: 'Hex-encoded payload piped to shell'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
pattern: /\bexec\b.*\b(base64|b64decode)\b/i,
|
|
202
|
+
reason: 'Exec with base64 decoding - obfuscated code execution'
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
pattern: /\bprintf\b.*\\x[0-9a-f].*\|\s*(bash|sh)\b/i,
|
|
206
|
+
reason: 'Printf hex payload piped to shell'
|
|
207
|
+
},
|
|
208
|
+
// Cloud metadata / SSRF — accessing cloud instance credentials
|
|
209
|
+
{
|
|
210
|
+
pattern: /169\.254\.169\.254/i,
|
|
211
|
+
reason: 'AWS/Azure IMDS access - potential credential theft'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
pattern: /metadata\.google\.internal/i,
|
|
215
|
+
reason: 'GCP metadata access - potential credential theft'
|
|
216
|
+
},
|
|
217
|
+
// Persistence — writing to shell profiles, cron, authorized_keys via echo/append
|
|
218
|
+
{
|
|
219
|
+
pattern: />>\s*~?\/?.*\/(authorized_keys|\.bashrc|\.bash_profile|\.zshrc|\.profile)/i,
|
|
220
|
+
reason: 'Appending to sensitive file - potential persistence mechanism'
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
pattern: /\bld\.so\.preload\b/i,
|
|
224
|
+
reason: 'LD_PRELOAD injection - shared library hijacking'
|
|
225
|
+
},
|
|
226
|
+
// wget with file upload
|
|
227
|
+
{
|
|
228
|
+
pattern: /wget\b.*--post-file/i,
|
|
229
|
+
reason: 'wget file upload - potential data exfiltration'
|
|
230
|
+
},
|
|
231
|
+
// pip install from custom index (supply chain attack)
|
|
232
|
+
{
|
|
233
|
+
pattern: /pip\b.*--index-url\s+https?:\/\/(?!pypi\.org)/i,
|
|
234
|
+
reason: 'pip install from non-PyPI index - potential supply chain attack'
|
|
235
|
+
},
|
|
236
|
+
// MCP server manipulation
|
|
237
|
+
{
|
|
238
|
+
pattern: /\bclaude\b.*\bmcp\b.*\badd\b/i,
|
|
239
|
+
reason: 'Adding MCP server - verify source is trusted'
|
|
240
|
+
},
|
|
135
241
|
];
|
|
136
242
|
/**
|
|
137
243
|
* Check if operation matches any pattern in array
|
|
@@ -144,11 +250,64 @@ export function matchesPattern(operation, patterns) {
|
|
|
144
250
|
}
|
|
145
251
|
return null;
|
|
146
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* Normalize file paths in Write/Edit/Read operations to resolve .. traversal.
|
|
255
|
+
* Prevents path traversal attacks like "Write: /home/user/../../etc/passwd"
|
|
256
|
+
* from matching safe home-directory patterns.
|
|
257
|
+
*/
|
|
258
|
+
export function normalizeOperation(operation) {
|
|
259
|
+
const match = operation.match(/^(Write|Edit|Read):\s*(\S+)/i);
|
|
260
|
+
if (match?.[2].includes('..')) {
|
|
261
|
+
const [, tool, rawPath] = match;
|
|
262
|
+
const normalizedPath = resolve(rawPath);
|
|
263
|
+
return `${tool}: ${normalizedPath}`;
|
|
264
|
+
}
|
|
265
|
+
return operation;
|
|
266
|
+
}
|
|
267
|
+
/** Check if a Bash command contains chain operators that could hide dangerous ops after a safe prefix. */
|
|
268
|
+
function containsChainOperators(operation) {
|
|
269
|
+
const commandPart = operation.replace(/^Bash:\s*/i, '');
|
|
270
|
+
return /;|&&|\|\||\n/.test(commandPart);
|
|
271
|
+
}
|
|
272
|
+
/** Check if a Bash command pipes output to known exfiltration/network tools or shells. */
|
|
273
|
+
function containsDangerousPipe(operation) {
|
|
274
|
+
const commandPart = operation.replace(/^Bash:\s*/i, '');
|
|
275
|
+
return /\|\s*(nc|netcat|ncat|curl|wget|scp|bash|sh)\b/i.test(commandPart);
|
|
276
|
+
}
|
|
277
|
+
/** Check if a Bash command redirects output to sensitive paths (append or overwrite). */
|
|
278
|
+
function containsSensitiveRedirect(operation) {
|
|
279
|
+
const commandPart = operation.replace(/^Bash:\s*/i, '');
|
|
280
|
+
return />>?\s*~?\/?.*\/(authorized_keys|\.bashrc|\.bash_profile|\.zshrc|\.profile|\.ssh\/|\.aws\/|\.gnupg\/|ld\.so\.preload|crontab|sudoers)/i.test(commandPart)
|
|
281
|
+
|| />>?\s*\/etc\//i.test(commandPart);
|
|
282
|
+
}
|
|
283
|
+
/** Check if a Bash command contains subshell or backtick expansion (not simple ${VAR}). */
|
|
284
|
+
function containsBashExpansion(operation) {
|
|
285
|
+
const commandPart = operation.replace(/^Bash:\s*/i, '');
|
|
286
|
+
return /`[^`]+`/.test(commandPart) || /\$\([^)]+\)/.test(commandPart);
|
|
287
|
+
}
|
|
288
|
+
/** Check if a Bash command contains any form of shell expansion: ${VAR}, $(...), or backticks. */
|
|
289
|
+
function containsAnyExpansion(operation) {
|
|
290
|
+
const cmd = operation.replace(/^Bash:\s*/i, '');
|
|
291
|
+
return /\$\{[^}]+\}/.test(cmd) || /\$\([^)]+\)/.test(cmd) || /`[^`]+`/.test(cmd);
|
|
292
|
+
}
|
|
293
|
+
/** Check if expansion is safely used as an argument to a known-safe command prefix.
|
|
294
|
+
* e.g., "echo ${HOME}" or "cat ${FILE}" — the expansion can't change the command itself. */
|
|
295
|
+
function isSafeExpansionUse(operation) {
|
|
296
|
+
const cmd = operation.replace(/^Bash:\s*/i, '').trim();
|
|
297
|
+
// If the expansion IS the command (first token), it's never safe
|
|
298
|
+
if (/^(\$\{|\$\(|`)/.test(cmd))
|
|
299
|
+
return false;
|
|
300
|
+
// Safe command prefixes where expansion as an argument is harmless
|
|
301
|
+
const safePrefix = /^(echo|printf|cat|ls|pwd|whoami|date|env|printenv|test|true|false)\s/i;
|
|
302
|
+
return safePrefix.test(cmd);
|
|
303
|
+
}
|
|
147
304
|
/**
|
|
148
305
|
* Determine if operation requires AI context review
|
|
149
306
|
*
|
|
150
307
|
* The philosophy here is:
|
|
151
|
-
* -
|
|
308
|
+
* - SENSITIVE_PATHS: Always require review (credentials, system configs)
|
|
309
|
+
* - SAFE_OPERATIONS: No review needed, UNLESS the bash command contains
|
|
310
|
+
* chain operators, dangerous pipes, or subshell/backtick expansion
|
|
152
311
|
* - CRITICAL_THREATS: Auto-deny, no review (catastrophic operations)
|
|
153
312
|
* - Everything else: AI reviews context to determine if it matches user intent
|
|
154
313
|
*/
|
|
@@ -162,18 +321,43 @@ const SAFE_RM_PATTERNS = [
|
|
|
162
321
|
/rm\s+-rf\s+(\.\/)?__pycache__($|\s)/i,
|
|
163
322
|
];
|
|
164
323
|
export function requiresAIReview(operation) {
|
|
165
|
-
|
|
324
|
+
// Normalize paths to prevent .. traversal bypass
|
|
325
|
+
const op = normalizeOperation(operation);
|
|
326
|
+
// Check sensitive paths BEFORE safe operations — prevents home-dir
|
|
327
|
+
// safe pattern from masking .ssh, .aws, .bashrc, etc.
|
|
328
|
+
if (matchesPattern(op, SENSITIVE_PATHS))
|
|
329
|
+
return true;
|
|
330
|
+
// Bash commands with any shell expansion (${VAR}, $(...), backticks) are
|
|
331
|
+
// opaque — the bouncer can't predict what they expand to at runtime.
|
|
332
|
+
// Route to AI review BEFORE checking CRITICAL_THREATS or SAFE_OPERATIONS,
|
|
333
|
+
// UNLESS the command is clearly safe (expansion is just an argument to a
|
|
334
|
+
// known-safe prefix like "echo ${HOME}").
|
|
335
|
+
if (/^Bash:/i.test(op) && containsAnyExpansion(op) && !isSafeExpansionUse(op)) {
|
|
336
|
+
return true;
|
|
337
|
+
}
|
|
338
|
+
if (matchesPattern(op, SAFE_OPERATIONS)) {
|
|
339
|
+
// Safe bash commands must not contain chain operators, dangerous pipes,
|
|
340
|
+
// or subshell/backtick expansion that could hide dangerous operations.
|
|
341
|
+
// A safe prefix (e.g., "git clone") with chain operators (&&, ;, ||)
|
|
342
|
+
// means the full command isn't necessarily safe — route to AI review.
|
|
343
|
+
if (/^Bash:/i.test(op) && (containsChainOperators(op) ||
|
|
344
|
+
containsDangerousPipe(op) ||
|
|
345
|
+
containsBashExpansion(op) ||
|
|
346
|
+
containsSensitiveRedirect(op))) {
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
166
349
|
return false;
|
|
167
|
-
|
|
350
|
+
}
|
|
351
|
+
if (matchesPattern(op, CRITICAL_THREATS))
|
|
168
352
|
return false;
|
|
169
|
-
if (matchesPattern(
|
|
170
|
-
return !SAFE_RM_PATTERNS.some(p => p.test(
|
|
353
|
+
if (matchesPattern(op, NEEDS_AI_REVIEW)) {
|
|
354
|
+
return !SAFE_RM_PATTERNS.some(p => p.test(op));
|
|
171
355
|
}
|
|
172
|
-
//
|
|
173
|
-
if (/^Bash:/.test(
|
|
174
|
-
if (
|
|
356
|
+
// Glob patterns and script execution are concerning in Bash commands
|
|
357
|
+
if (/^Bash:/.test(op)) {
|
|
358
|
+
if (/\*\*?/.test(op))
|
|
175
359
|
return true;
|
|
176
|
-
if (/^Bash:\s*\.\//.test(
|
|
360
|
+
if (/^Bash:\s*\.\//.test(op))
|
|
177
361
|
return true;
|
|
178
362
|
}
|
|
179
363
|
return false;
|
|
@@ -220,6 +404,9 @@ export function classifyRisk(operation) {
|
|
|
220
404
|
{ pattern: /chmod\s+777/i, reason: 'Dangerous permissions' },
|
|
221
405
|
{ pattern: /(curl|wget).*\|.*(bash|sh)/i, reason: 'Remote code execution' },
|
|
222
406
|
{ pattern: /pkill|killall/i, reason: 'Process termination' },
|
|
407
|
+
{ pattern: /\|\s*(nc|netcat|ncat)\b/i, reason: 'Data exfiltration via netcat' },
|
|
408
|
+
{ pattern: /\bscp\b.*@/i, reason: 'Data exfiltration via SCP' },
|
|
409
|
+
{ pattern: /curl\b.*-d\s*@/i, reason: 'Data exfiltration via curl file upload' },
|
|
223
410
|
];
|
|
224
411
|
for (const pattern of elevatedPatterns) {
|
|
225
412
|
if (pattern.pattern.test(operation)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-patterns.js","sourceRoot":"","sources":["../../../server/mcp/security-patterns.ts"],"names":[],"m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0DAA0D;IAC1D,4EAA4E;IAC5E,IAAI,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,sDAAsD;QACtD,IAAI,cAAc,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,CAAC;YAC/C,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACjE,CAAC;QACD,OAAO;YACL,aAAa,EAAE,IAAI;YACnB,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,CAAC,oBAAoB,CAAC;SAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -41,6 +41,5 @@ export declare class WebSocketImproviseHandler implements HandlerContext {
|
|
|
41
41
|
broadcastToOthers(sender: WSContext, response: WebSocketResponse): void;
|
|
42
42
|
broadcastToAll(response: WebSocketResponse): void;
|
|
43
43
|
cleanupSession(sessionId: string): void;
|
|
44
|
-
cleanupStaleSessions(): void;
|
|
45
44
|
}
|
|
46
45
|
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../server/services/websocket/handler.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../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CAAC,CAAa;IAC7D,iBAAiB,EAAE,iBAAiB,GAAG,IAAI,CAAQ;;IAQnD,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe;IAOhD,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI/C,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,gBAAgB;IAYxB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAK3C,gBAAgB,CAAC,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAKpD,aAAa,CACjB,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;YAkBF,eAAe;IA8H7B,OAAO,CAAC,uBAAuB;IAuB/B,WAAW,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI;IAMhC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAQtD,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAQvE,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAMjD,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAIxC"}
|
|
@@ -8,6 +8,7 @@ import { AutocompleteService } from './autocomplete.js';
|
|
|
8
8
|
import { handleFileExplorerMessage, handleFileMessage } from './file-explorer-handlers.js';
|
|
9
9
|
import { FileUploadHandler } from './file-upload-handler.js';
|
|
10
10
|
import { handleGitMessage } from './git-handlers.js';
|
|
11
|
+
import { handleQualityMessage } from './quality-handlers.js';
|
|
11
12
|
import { handleHistoryMessage, handleSessionMessage, initializeTab, resumeHistoricalSession } from './session-handlers.js';
|
|
12
13
|
import { SessionRegistry } from './session-registry.js';
|
|
13
14
|
import { generateNotificationSummary, handleGetSettings, handleUpdateSettings } from './settings-handlers.js';
|
|
@@ -196,6 +197,12 @@ export class WebSocketImproviseHandler {
|
|
|
196
197
|
return handleRemoveTab(this, ws, tabId, workingDir);
|
|
197
198
|
case 'markTabViewed':
|
|
198
199
|
return handleMarkTabViewed(this, ws, tabId, workingDir);
|
|
200
|
+
// Quality messages
|
|
201
|
+
case 'qualityDetectTools':
|
|
202
|
+
case 'qualityScan':
|
|
203
|
+
case 'qualityInstallTools':
|
|
204
|
+
case 'qualityCodeReview':
|
|
205
|
+
return handleQualityMessage(this, ws, msg, tabId, workingDir);
|
|
199
206
|
// Settings messages
|
|
200
207
|
case 'getSettings':
|
|
201
208
|
return handleGetSettings(this, ws);
|
|
@@ -260,7 +267,5 @@ export class WebSocketImproviseHandler {
|
|
|
260
267
|
cleanupSession(sessionId) {
|
|
261
268
|
this.sessions.delete(sessionId);
|
|
262
269
|
}
|
|
263
|
-
cleanupStaleSessions() {
|
|
264
|
-
}
|
|
265
270
|
}
|
|
266
271
|
//# sourceMappingURL=handler.js.map
|