mcp-rce-guard 0.1.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/LICENSE +21 -0
- package/README.md +155 -0
- package/dist/audit/log.d.ts +75 -0
- package/dist/audit/log.d.ts.map +1 -0
- package/dist/audit/log.js +191 -0
- package/dist/audit/log.js.map +1 -0
- package/dist/canary/tracker.d.ts +38 -0
- package/dist/canary/tracker.d.ts.map +1 -0
- package/dist/canary/tracker.js +40 -0
- package/dist/canary/tracker.js.map +1 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +128 -0
- package/dist/cli.js.map +1 -0
- package/dist/cve/replay.d.ts +44 -0
- package/dist/cve/replay.d.ts.map +1 -0
- package/dist/cve/replay.js +221 -0
- package/dist/cve/replay.js.map +1 -0
- package/dist/egress/policy.d.ts +27 -0
- package/dist/egress/policy.d.ts.map +1 -0
- package/dist/egress/policy.js +62 -0
- package/dist/egress/policy.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/isolation/cgroups.d.ts +20 -0
- package/dist/isolation/cgroups.d.ts.map +1 -0
- package/dist/isolation/cgroups.js +33 -0
- package/dist/isolation/cgroups.js.map +1 -0
- package/dist/isolation/landlock.d.ts +42 -0
- package/dist/isolation/landlock.d.ts.map +1 -0
- package/dist/isolation/landlock.js +67 -0
- package/dist/isolation/landlock.js.map +1 -0
- package/dist/isolation/platform.d.ts +27 -0
- package/dist/isolation/platform.d.ts.map +1 -0
- package/dist/isolation/platform.js +96 -0
- package/dist/isolation/platform.js.map +1 -0
- package/dist/isolation/sandbox-exec.d.ts +17 -0
- package/dist/isolation/sandbox-exec.d.ts.map +1 -0
- package/dist/isolation/sandbox-exec.js +58 -0
- package/dist/isolation/sandbox-exec.js.map +1 -0
- package/dist/normalize.d.ts +32 -0
- package/dist/normalize.d.ts.map +1 -0
- package/dist/normalize.js +66 -0
- package/dist/normalize.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +152 -0
- package/dist/server.js.map +1 -0
- package/dist/state.d.ts +34 -0
- package/dist/state.d.ts.map +1 -0
- package/dist/state.js +104 -0
- package/dist/state.js.map +1 -0
- package/dist/tools/audit.d.ts +26 -0
- package/dist/tools/audit.d.ts.map +1 -0
- package/dist/tools/audit.js +97 -0
- package/dist/tools/audit.js.map +1 -0
- package/dist/tools/getAuditLog.d.ts +34 -0
- package/dist/tools/getAuditLog.d.ts.map +1 -0
- package/dist/tools/getAuditLog.js +65 -0
- package/dist/tools/getAuditLog.js.map +1 -0
- package/dist/tools/injectEgress.d.ts +21 -0
- package/dist/tools/injectEgress.d.ts.map +1 -0
- package/dist/tools/injectEgress.js +49 -0
- package/dist/tools/injectEgress.js.map +1 -0
- package/dist/tools/register.d.ts +16 -0
- package/dist/tools/register.d.ts.map +1 -0
- package/dist/tools/register.js +44 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/scanCve.d.ts +14 -0
- package/dist/tools/scanCve.d.ts.map +1 -0
- package/dist/tools/scanCve.js +29 -0
- package/dist/tools/scanCve.js.map +1 -0
- package/dist/tools/trackCanary.d.ts +23 -0
- package/dist/tools/trackCanary.d.ts.map +1 -0
- package/dist/tools/trackCanary.js +44 -0
- package/dist/tools/trackCanary.js.map +1 -0
- package/dist/trust-tiers.d.ts +18 -0
- package/dist/trust-tiers.d.ts.map +1 -0
- package/dist/trust-tiers.js +73 -0
- package/dist/trust-tiers.js.map +1 -0
- package/dist/types.d.ts +187 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +82 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +14 -0
- package/dist/version.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: track_canary
|
|
3
|
+
*
|
|
4
|
+
* Issues a canary token + registers a chain. v0.1 returns the token + a
|
|
5
|
+
* pre-evaluated leakDetected=false because actual leak detection requires
|
|
6
|
+
* the calling MCP-aware controller to feed downstream-server output back
|
|
7
|
+
* via a corpus parameter (added in v0.2).
|
|
8
|
+
*
|
|
9
|
+
* Pattern provenance: arXiv 2604.27819 (MCPHunt, April 2026) — taint
|
|
10
|
+
* tracking via canary-token injection across MCP server boundaries.
|
|
11
|
+
*
|
|
12
|
+
* Confused-Deputy defense (CVE-2026-27124): if the chain controller pipes
|
|
13
|
+
* downstream output back to detect_leaks, a leak via egress channel will
|
|
14
|
+
* be flagged.
|
|
15
|
+
*/
|
|
16
|
+
import { TrackCanaryArgsSchema } from "../types.js";
|
|
17
|
+
import { registerCanaryChain } from "../state.js";
|
|
18
|
+
import { makeCanary } from "../canary/tracker.js";
|
|
19
|
+
import { appendAudit } from "../audit/log.js";
|
|
20
|
+
export async function trackCanaryTool(rawArgs) {
|
|
21
|
+
const args = TrackCanaryArgsSchema.parse(rawArgs);
|
|
22
|
+
const { token, pattern } = makeCanary(args.canaryPattern);
|
|
23
|
+
registerCanaryChain(args.chainId, args.sourceServerId, args.downstreamServerIds, pattern, token);
|
|
24
|
+
// v0.1: leak detection requires a separate corpus feed; here we always
|
|
25
|
+
// return false at registration time. The library export `detectLeaks`
|
|
26
|
+
// is the entry-point for callers that want to scan their own corpus.
|
|
27
|
+
await appendAudit({
|
|
28
|
+
subprocessHandle: "n/a",
|
|
29
|
+
action: "track_canary",
|
|
30
|
+
verdict: "approve",
|
|
31
|
+
serverId: args.sourceServerId,
|
|
32
|
+
meta: {
|
|
33
|
+
chainId: args.chainId,
|
|
34
|
+
downstreamServerIds: args.downstreamServerIds,
|
|
35
|
+
tokenPrefix: token.slice(0, 24)
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
canaryToken: token,
|
|
40
|
+
leakDetected: false,
|
|
41
|
+
leakLocations: []
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=trackCanary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trackCanary.js","sourceRoot":"","sources":["../../src/tools/trackCanary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,qBAAqB,EAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAqB,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAQ9C,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAgB;IACpD,MAAM,IAAI,GAAoB,qBAAqB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEnE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1D,mBAAmB,CACjB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,mBAAmB,EACxB,OAAO,EACP,KAAK,CACN,CAAC;IAEF,uEAAuE;IACvE,sEAAsE;IACtE,qEAAqE;IACrE,MAAM,WAAW,CAAC;QAChB,gBAAgB,EAAE,KAAK;QACvB,MAAM,EAAE,cAAc;QACtB,OAAO,EAAE,SAAS;QAClB,QAAQ,EAAE,IAAI,CAAC,cAAc;QAC7B,IAAI,EAAE;YACJ,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;SAChC;KACF,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,KAAK;QACnB,aAAa,EAAE,EAAE;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trust-Tier defaults for register_subprocess.
|
|
3
|
+
*
|
|
4
|
+
* Each tier defines a sensible isolation profile so callers can register
|
|
5
|
+
* a subprocess with minimal config. Profiles are intentionally conservative
|
|
6
|
+
* — escalation requires explicit per-field overrides.
|
|
7
|
+
*
|
|
8
|
+
* Anti-Pattern provenance: Nginx-MCP RCE CVSS 9.8 (subprocess inheritert
|
|
9
|
+
* volle parent-permissions weil keine Profile-Defaults existieren).
|
|
10
|
+
*/
|
|
11
|
+
import type { IsolationProfile } from "./types.js";
|
|
12
|
+
export type TrustTier = "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
|
|
13
|
+
export declare const TRUST_TIER_DEFAULTS: Record<TrustTier, IsolationProfile>;
|
|
14
|
+
/**
|
|
15
|
+
* Merge a partial profile onto a tier default. Caller-supplied fields win.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveProfile(tier: TrustTier, override: Partial<IsolationProfile>): IsolationProfile;
|
|
18
|
+
//# sourceMappingURL=trust-tiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-tiers.d.ts","sourceRoot":"","sources":["../src/trust-tiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,SAAS,EAAE,gBAAgB,CA+CnE,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAClC,gBAAgB,CAUlB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trust-Tier defaults for register_subprocess.
|
|
3
|
+
*
|
|
4
|
+
* Each tier defines a sensible isolation profile so callers can register
|
|
5
|
+
* a subprocess with minimal config. Profiles are intentionally conservative
|
|
6
|
+
* — escalation requires explicit per-field overrides.
|
|
7
|
+
*
|
|
8
|
+
* Anti-Pattern provenance: Nginx-MCP RCE CVSS 9.8 (subprocess inheritert
|
|
9
|
+
* volle parent-permissions weil keine Profile-Defaults existieren).
|
|
10
|
+
*/
|
|
11
|
+
export const TRUST_TIER_DEFAULTS = {
|
|
12
|
+
/**
|
|
13
|
+
* LOW = highest isolation. For unverified third-party MCP tools.
|
|
14
|
+
* Read-only fs, tiny scratch, no egress, hard CPU/mem caps.
|
|
15
|
+
*/
|
|
16
|
+
LOW: {
|
|
17
|
+
fsReadOnly: ["/usr", "/lib", "/lib64", "/bin", "/sbin", "/etc"],
|
|
18
|
+
fsWritable: [],
|
|
19
|
+
cpuMs: 5_000,
|
|
20
|
+
memMB: 128,
|
|
21
|
+
pidMax: 32,
|
|
22
|
+
egressAllowlist: []
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* MEDIUM = medium isolation. For first-party tools that need light egress.
|
|
26
|
+
*/
|
|
27
|
+
MEDIUM: {
|
|
28
|
+
fsReadOnly: ["/usr", "/lib", "/lib64", "/bin", "/sbin", "/etc"],
|
|
29
|
+
fsWritable: [],
|
|
30
|
+
cpuMs: 30_000,
|
|
31
|
+
memMB: 512,
|
|
32
|
+
pidMax: 128,
|
|
33
|
+
egressAllowlist: ["api.anthropic.com:443", "api.openai.com:443"]
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* HIGH = relaxed isolation. For tools that need broader egress + larger budgets.
|
|
37
|
+
*/
|
|
38
|
+
HIGH: {
|
|
39
|
+
fsReadOnly: ["/usr", "/lib", "/lib64", "/bin", "/sbin", "/etc"],
|
|
40
|
+
fsWritable: [],
|
|
41
|
+
cpuMs: 120_000,
|
|
42
|
+
memMB: 2048,
|
|
43
|
+
pidMax: 512,
|
|
44
|
+
egressAllowlist: ["api.anthropic.com:443", "api.openai.com:443", "github.com:443"]
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* CRITICAL = minimum isolation. Audit-only egress (still default-deny on caps).
|
|
48
|
+
* Use only for fully-trusted first-party tools that need broad system access.
|
|
49
|
+
*/
|
|
50
|
+
CRITICAL: {
|
|
51
|
+
fsReadOnly: [],
|
|
52
|
+
fsWritable: [],
|
|
53
|
+
cpuMs: 600_000,
|
|
54
|
+
memMB: 8192,
|
|
55
|
+
pidMax: 2048,
|
|
56
|
+
egressAllowlist: ["*"]
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Merge a partial profile onto a tier default. Caller-supplied fields win.
|
|
61
|
+
*/
|
|
62
|
+
export function resolveProfile(tier, override) {
|
|
63
|
+
const base = TRUST_TIER_DEFAULTS[tier];
|
|
64
|
+
return {
|
|
65
|
+
fsReadOnly: override.fsReadOnly ?? base.fsReadOnly,
|
|
66
|
+
fsWritable: override.fsWritable ?? base.fsWritable,
|
|
67
|
+
cpuMs: override.cpuMs ?? base.cpuMs,
|
|
68
|
+
memMB: override.memMB ?? base.memMB,
|
|
69
|
+
pidMax: override.pidMax ?? base.pidMax,
|
|
70
|
+
egressAllowlist: override.egressAllowlist ?? base.egressAllowlist
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=trust-tiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trust-tiers.js","sourceRoot":"","sources":["../src/trust-tiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,CAAC,MAAM,mBAAmB,GAAwC;IACtE;;;OAGG;IACH,GAAG,EAAE;QACH,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;QAC/D,UAAU,EAAE,EAAE;QACd,KAAK,EAAE,KAAK;QACZ,KAAK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,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM;QACtC,eAAe,EAAE,QAAQ,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe;KAClE,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types + Zod schemas for mcp-rce-guard tools.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
/**
|
|
6
|
+
* Isolation profile applied to a subprocess at register_subprocess time.
|
|
7
|
+
* Field semantics are platform-dependent — see src/isolation/{landlock,sandbox-exec,cgroups}.ts
|
|
8
|
+
* for how each field is realized on Linux + macOS.
|
|
9
|
+
*/
|
|
10
|
+
export interface IsolationProfile {
|
|
11
|
+
/** Read-only filesystem roots the subprocess may traverse. */
|
|
12
|
+
fsReadOnly: string[];
|
|
13
|
+
/** Writable scratch directories (typically per-spawn ephemeral). */
|
|
14
|
+
fsWritable: string[];
|
|
15
|
+
/** CPU time cap in milliseconds. Soft cap, enforced via cgroups-v2 cpu.max on Linux. */
|
|
16
|
+
cpuMs?: number;
|
|
17
|
+
/** RSS cap in megabytes. Hard cap, enforced via cgroups-v2 memory.max on Linux. */
|
|
18
|
+
memMB?: number;
|
|
19
|
+
/** Max child PIDs. Hard cap, enforced via cgroups-v2 pids.max on Linux. */
|
|
20
|
+
pidMax?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Network egress allowlist as host:port pairs. "*" allows all (audit-only).
|
|
23
|
+
* Default-deny: empty array blocks all egress.
|
|
24
|
+
*/
|
|
25
|
+
egressAllowlist: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare const IsolationProfileSchema: z.ZodObject<{
|
|
28
|
+
fsReadOnly: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
29
|
+
fsWritable: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
30
|
+
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
memMB: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
pidMax: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
egressAllowlist: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const TrustTierSchema: z.ZodEnum<{
|
|
36
|
+
LOW: "LOW";
|
|
37
|
+
MEDIUM: "MEDIUM";
|
|
38
|
+
HIGH: "HIGH";
|
|
39
|
+
CRITICAL: "CRITICAL";
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Args for register_subprocess.
|
|
43
|
+
*/
|
|
44
|
+
export declare const RegisterSubprocessArgsSchema: z.ZodObject<{
|
|
45
|
+
serverId: z.ZodString;
|
|
46
|
+
binary: z.ZodString;
|
|
47
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
48
|
+
trustTier: z.ZodEnum<{
|
|
49
|
+
LOW: "LOW";
|
|
50
|
+
MEDIUM: "MEDIUM";
|
|
51
|
+
HIGH: "HIGH";
|
|
52
|
+
CRITICAL: "CRITICAL";
|
|
53
|
+
}>;
|
|
54
|
+
isolationProfile: z.ZodDefault<z.ZodObject<{
|
|
55
|
+
fsReadOnly: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
56
|
+
fsWritable: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
57
|
+
cpuMs: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
58
|
+
memMB: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
59
|
+
pidMax: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
60
|
+
egressAllowlist: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type RegisterSubprocessArgs = z.infer<typeof RegisterSubprocessArgsSchema>;
|
|
64
|
+
/**
|
|
65
|
+
* Args for audit_subprocess.
|
|
66
|
+
*/
|
|
67
|
+
export declare const AuditSubprocessArgsSchema: z.ZodObject<{
|
|
68
|
+
subprocessHandle: z.ZodString;
|
|
69
|
+
requestedArgs: z.ZodArray<z.ZodString>;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
export type AuditSubprocessArgs = z.infer<typeof AuditSubprocessArgsSchema>;
|
|
72
|
+
export declare const AuditVerdict: z.ZodEnum<{
|
|
73
|
+
approve: "approve";
|
|
74
|
+
block: "block";
|
|
75
|
+
quarantine: "quarantine";
|
|
76
|
+
}>;
|
|
77
|
+
export type AuditVerdictType = z.infer<typeof AuditVerdict>;
|
|
78
|
+
/**
|
|
79
|
+
* Args for scan_cve_replay.
|
|
80
|
+
*/
|
|
81
|
+
export declare const CveIdSchema: z.ZodEnum<{
|
|
82
|
+
"mcp-sdk-rce-2026-04-22": "mcp-sdk-rce-2026-04-22";
|
|
83
|
+
"cve-2026-27124": "cve-2026-27124";
|
|
84
|
+
"nginx-mcp-rce-9.8": "nginx-mcp-rce-9.8";
|
|
85
|
+
}>;
|
|
86
|
+
export type CveId = z.infer<typeof CveIdSchema>;
|
|
87
|
+
export declare const ScanCveReplayArgsSchema: z.ZodObject<{
|
|
88
|
+
targetServerCommand: z.ZodString;
|
|
89
|
+
cveSet: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
90
|
+
"mcp-sdk-rce-2026-04-22": "mcp-sdk-rce-2026-04-22";
|
|
91
|
+
"cve-2026-27124": "cve-2026-27124";
|
|
92
|
+
"nginx-mcp-rce-9.8": "nginx-mcp-rce-9.8";
|
|
93
|
+
}>>>;
|
|
94
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type ScanCveReplayArgs = z.infer<typeof ScanCveReplayArgsSchema>;
|
|
97
|
+
/**
|
|
98
|
+
* Args for track_canary.
|
|
99
|
+
*/
|
|
100
|
+
export declare const TrackCanaryArgsSchema: z.ZodObject<{
|
|
101
|
+
chainId: z.ZodString;
|
|
102
|
+
sourceServerId: z.ZodString;
|
|
103
|
+
downstreamServerIds: z.ZodArray<z.ZodString>;
|
|
104
|
+
canaryPattern: z.ZodOptional<z.ZodString>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type TrackCanaryArgs = z.infer<typeof TrackCanaryArgsSchema>;
|
|
107
|
+
/**
|
|
108
|
+
* Args for inject_egress_policy.
|
|
109
|
+
*/
|
|
110
|
+
export declare const EgressModeSchema: z.ZodEnum<{
|
|
111
|
+
"default-deny": "default-deny";
|
|
112
|
+
"audit-only": "audit-only";
|
|
113
|
+
}>;
|
|
114
|
+
export type EgressMode = z.infer<typeof EgressModeSchema>;
|
|
115
|
+
export declare const InjectEgressPolicyArgsSchema: z.ZodObject<{
|
|
116
|
+
subprocessHandle: z.ZodString;
|
|
117
|
+
allowlist: z.ZodArray<z.ZodString>;
|
|
118
|
+
mode: z.ZodEnum<{
|
|
119
|
+
"default-deny": "default-deny";
|
|
120
|
+
"audit-only": "audit-only";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
export type InjectEgressPolicyArgs = z.infer<typeof InjectEgressPolicyArgsSchema>;
|
|
124
|
+
/**
|
|
125
|
+
* Args for get_audit_log.
|
|
126
|
+
*
|
|
127
|
+
* `staleEgressModeThresholdDays` (default 7) drives the audit-only-staleness
|
|
128
|
+
* WARN list — see PLAN.md §Predicted-Impact §inject_egress_policy
|
|
129
|
+
* at-risk-regression-mitigation. Operators can lower the threshold for
|
|
130
|
+
* stricter staleness or set it to 0 to disable the check.
|
|
131
|
+
*/
|
|
132
|
+
export declare const GetAuditLogArgsSchema: z.ZodObject<{
|
|
133
|
+
subprocessHandle: z.ZodOptional<z.ZodString>;
|
|
134
|
+
since: z.ZodOptional<z.ZodString>;
|
|
135
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
136
|
+
staleEgressModeThresholdDays: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
export type GetAuditLogArgs = z.infer<typeof GetAuditLogArgsSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* One entry in the get_audit_log staleness-WARN list. Emitted when a
|
|
141
|
+
* registered subprocess has been left in egressMode="audit-only" longer
|
|
142
|
+
* than `staleEgressModeThresholdDays`. See PLAN.md §Predicted-Impact
|
|
143
|
+
* §inject_egress_policy.
|
|
144
|
+
*/
|
|
145
|
+
export interface StaleEgressModeWarning {
|
|
146
|
+
subprocessHandle: string;
|
|
147
|
+
serverId: string;
|
|
148
|
+
egressMode: EgressMode;
|
|
149
|
+
egressModeSetAt: string;
|
|
150
|
+
ageDays: number;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Audit-log entry shape (NDJSON line in ~/.mcp-rce-guard/audit.log).
|
|
154
|
+
*/
|
|
155
|
+
export interface AuditLogEntry {
|
|
156
|
+
ts: string;
|
|
157
|
+
subprocessHandle: string;
|
|
158
|
+
action: string;
|
|
159
|
+
verdict: string;
|
|
160
|
+
serverId?: string;
|
|
161
|
+
reason?: string;
|
|
162
|
+
meta?: Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Internal subprocess registry record.
|
|
166
|
+
*/
|
|
167
|
+
export interface RegisteredSubprocess {
|
|
168
|
+
subprocessHandle: string;
|
|
169
|
+
serverId: string;
|
|
170
|
+
binary: string;
|
|
171
|
+
args: string[];
|
|
172
|
+
trustTier: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL";
|
|
173
|
+
profile: IsolationProfile;
|
|
174
|
+
profileFingerprint: string;
|
|
175
|
+
/** Active egress mode after inject_egress_policy. Defaults to default-deny. */
|
|
176
|
+
egressMode: EgressMode;
|
|
177
|
+
/**
|
|
178
|
+
* ISO timestamp of the last egress-mode transition. Initialised to
|
|
179
|
+
* registeredAt and bumped on every inject_egress_policy that successfully
|
|
180
|
+
* applies. Drives the audit-only-staleness WARN in get_audit_log.
|
|
181
|
+
*/
|
|
182
|
+
egressModeSetAt: string;
|
|
183
|
+
/** Tracked blocked-egress attempts since policy injection. */
|
|
184
|
+
blockedEgressAttempts: number;
|
|
185
|
+
registeredAt: string;
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oEAAoE;IACpE,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,sBAAsB;;;;;;;iBAOjC,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;EAAgD,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,YAAY;;;;EAA6C,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,WAAW;;;;EA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AC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAClD,OAAO,EAAE,gBAAgB,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,UAAU,EAAE,UAAU,CAAC;IACvB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB,8DAA8D;IAC9D,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types + Zod schemas for mcp-rce-guard tools.
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export const IsolationProfileSchema = z.object({
|
|
6
|
+
fsReadOnly: z.array(z.string()).default([]),
|
|
7
|
+
fsWritable: z.array(z.string()).default([]),
|
|
8
|
+
cpuMs: z.number().int().positive().optional(),
|
|
9
|
+
memMB: z.number().int().positive().optional(),
|
|
10
|
+
pidMax: z.number().int().positive().optional(),
|
|
11
|
+
egressAllowlist: z.array(z.string()).default([])
|
|
12
|
+
});
|
|
13
|
+
export const TrustTierSchema = z.enum(["LOW", "MEDIUM", "HIGH", "CRITICAL"]);
|
|
14
|
+
/**
|
|
15
|
+
* Args for register_subprocess.
|
|
16
|
+
*/
|
|
17
|
+
export const RegisterSubprocessArgsSchema = z.object({
|
|
18
|
+
serverId: z.string().min(1).max(200),
|
|
19
|
+
binary: z.string().min(1).max(1000),
|
|
20
|
+
args: z.array(z.string().max(4000)).max(256).default([]),
|
|
21
|
+
trustTier: TrustTierSchema,
|
|
22
|
+
isolationProfile: IsolationProfileSchema.partial().default({})
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Args for audit_subprocess.
|
|
26
|
+
*/
|
|
27
|
+
export const AuditSubprocessArgsSchema = z.object({
|
|
28
|
+
subprocessHandle: z.string().min(1),
|
|
29
|
+
requestedArgs: z.array(z.string().max(4000)).max(256)
|
|
30
|
+
});
|
|
31
|
+
export const AuditVerdict = z.enum(["approve", "block", "quarantine"]);
|
|
32
|
+
/**
|
|
33
|
+
* Args for scan_cve_replay.
|
|
34
|
+
*/
|
|
35
|
+
export const CveIdSchema = z.enum([
|
|
36
|
+
"mcp-sdk-rce-2026-04-22",
|
|
37
|
+
"cve-2026-27124",
|
|
38
|
+
"nginx-mcp-rce-9.8"
|
|
39
|
+
]);
|
|
40
|
+
export const ScanCveReplayArgsSchema = z.object({
|
|
41
|
+
targetServerCommand: z.string().min(1).max(2000),
|
|
42
|
+
cveSet: z.array(CveIdSchema).min(1).max(16).optional(),
|
|
43
|
+
timeoutMs: z.number().int().positive().max(300_000).default(30_000)
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Args for track_canary.
|
|
47
|
+
*/
|
|
48
|
+
export const TrackCanaryArgsSchema = z.object({
|
|
49
|
+
chainId: z.string().min(1).max(200),
|
|
50
|
+
sourceServerId: z.string().min(1).max(200),
|
|
51
|
+
downstreamServerIds: z.array(z.string().min(1).max(200)).min(1).max(32),
|
|
52
|
+
canaryPattern: z.string().min(8).max(256).optional()
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Args for inject_egress_policy.
|
|
56
|
+
*/
|
|
57
|
+
export const EgressModeSchema = z.enum(["default-deny", "audit-only"]);
|
|
58
|
+
export const InjectEgressPolicyArgsSchema = z.object({
|
|
59
|
+
subprocessHandle: z.string().min(1),
|
|
60
|
+
allowlist: z.array(z.string().min(1).max(500)).max(256),
|
|
61
|
+
mode: EgressModeSchema
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Args for get_audit_log.
|
|
65
|
+
*
|
|
66
|
+
* `staleEgressModeThresholdDays` (default 7) drives the audit-only-staleness
|
|
67
|
+
* WARN list — see PLAN.md §Predicted-Impact §inject_egress_policy
|
|
68
|
+
* at-risk-regression-mitigation. Operators can lower the threshold for
|
|
69
|
+
* stricter staleness or set it to 0 to disable the check.
|
|
70
|
+
*/
|
|
71
|
+
export const GetAuditLogArgsSchema = z.object({
|
|
72
|
+
subprocessHandle: z.string().min(1).optional(),
|
|
73
|
+
since: z.string().datetime().optional(),
|
|
74
|
+
limit: z.number().int().positive().max(10_000).default(100),
|
|
75
|
+
staleEgressModeThresholdDays: z
|
|
76
|
+
.number()
|
|
77
|
+
.int()
|
|
78
|
+
.min(0)
|
|
79
|
+
.max(365)
|
|
80
|
+
.default(7)
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,E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}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read the version from package.json at runtime so tests + server + CLI
|
|
3
|
+
* never drift from the actual published version.
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
// dist/version.js -> ../package.json
|
|
10
|
+
const pkgPath = join(here, "..", "package.json");
|
|
11
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
12
|
+
export const NAME = pkg.name;
|
|
13
|
+
export const VERSION = pkg.version;
|
|
14
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAOjD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAY,CAAC;AAEjE,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-rce-guard",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "v0.1 policy-synthesis (descriptor-only) for MCP-server RCE defense: landlock/sandbox-exec/cgroups-v2 profile builder + CVE-replay predicates + canary tracker + append-only NDJSON audit log. v0.2 adds native enforcement + verified Acra-pattern audit-log signing.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Matthias Meyer (StudioMeyer)",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/server.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./server": {
|
|
16
|
+
"types": "./dist/server.d.ts",
|
|
17
|
+
"import": "./dist/server.js"
|
|
18
|
+
},
|
|
19
|
+
"./normalize": {
|
|
20
|
+
"types": "./dist/normalize.d.ts",
|
|
21
|
+
"import": "./dist/normalize.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"mcp-rce-guard": "./dist/cli.js",
|
|
26
|
+
"mcp-rce-guard-server": "./dist/server.js"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p tsconfig.build.json && node scripts/post-build.js",
|
|
35
|
+
"prepack": "npm run build",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"mcp",
|
|
41
|
+
"model-context-protocol",
|
|
42
|
+
"security",
|
|
43
|
+
"sandbox",
|
|
44
|
+
"rce",
|
|
45
|
+
"landlock",
|
|
46
|
+
"cve",
|
|
47
|
+
"isolation",
|
|
48
|
+
"canary",
|
|
49
|
+
"policy-synthesizer"
|
|
50
|
+
],
|
|
51
|
+
"repository": {
|
|
52
|
+
"type": "git",
|
|
53
|
+
"url": "https://github.com/studiomeyer-io/mcp-rce-guard.git"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/studiomeyer-io/mcp-rce-guard#readme",
|
|
56
|
+
"bugs": {
|
|
57
|
+
"url": "https://github.com/studiomeyer-io/mcp-rce-guard/issues"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
61
|
+
"commander": "^14.0.3",
|
|
62
|
+
"execa": "^9.6.1",
|
|
63
|
+
"zod": "^4.4.3"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^25.6.2",
|
|
67
|
+
"tsup": "^8.5.1",
|
|
68
|
+
"typescript": "^6.0.3",
|
|
69
|
+
"vitest": "^4.1.5"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=20"
|
|
73
|
+
}
|
|
74
|
+
}
|