prism-mcp-server 9.4.3 β†’ 9.4.5

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 CHANGED
@@ -826,8 +826,10 @@ The Generator strips the `console.log`, resubmits, and the next `EVALUATE` retur
826
826
 
827
827
  ## πŸ†• What's New
828
828
 
829
- > **Current release: v9.4.2 β€” Shell Injection Fix (Git Drift Detection)**
829
+ > **Current release: v9.4.5 β€” Security: Command Injection Fix & Dependency Reduction**
830
830
 
831
+ - πŸ”’ **v9.4.5 β€” Command Injection Fix & Dep Reduction:** `isOrphanProcess()` in `lifecycle.ts` interpolated a file-sourced PID into `execSync`. Fixed with `execFileSync` (no shell). Removed 2 unused runtime deps (25 β†’ 23). Closes [#53](https://github.com/dcostenco/prism-mcp/issues/53).
832
+ - πŸ”§ **v9.4.3 β€” ESM Bundling Fix:** Bundled dist had inlined OpenTelemetry CJS `require("async_hooks")` into ESM chunks, causing `Dynamic require of "async_hooks" is not supported` at runtime. Rebuilt with `tsc`. Affects CLI, session save/load, and MCP server startup.
831
833
  - πŸ”’ **v9.4.2 β€” Shell Injection Fix:** Deep code review found shell injection in `getGitDrift()` β€” `oldSha` was interpolated into `execSync` template string. Fixed with SHA format validation + `execFileSync` (no shell). Defense-in-depth.
832
834
  - πŸ”’ **v9.4.1 β€” Security Hardening & Bidirectional Sync:** Two-pass adversarial audit found 18 vulnerabilities (4C/5H/9M) β€” 17 fixed. Critical: fail-closed rate limiter, path traversal guards, error sanitization. High: plan name alignment (revenue fix), CORS allowlist, settings injection prevention. New: bidirectional `prism sync push` CLI command pushes local SQLite β†’ Supabase, JWT enrichment eliminates N+1 DB queries, concurrency counter guaranteed via `try/finally`, 10MB request body limits.
833
835
  - 🎯 **v9.3.0 β€” TurboQuant ResidualNorm Tiebreaker:** Configurable ranking optimization for Tier-2 search. When compressed cosine scores are within Ξ΅ of each other, prefers the candidate with lower `residualNorm` (more trustworthy compressed representation). `PRISM_TURBOQUANT_TIEBREAKER_EPSILON=0.005` gives +2pp R@1, +1pp R@5. Empirically validated at N=5K with A/B test. 1066 tests, 0 regressions. Inspired by [@m13v's suggestion](https://github.com/xiaowu0162/LongMemEval/issues/31).
@@ -1240,6 +1242,7 @@ Prism has evolved from smart session logging into a **cognitive memory architect
1240
1242
  | **v9.0** | Cognitive Budget β€” per-project token economy with passive UBI recovery (+100 tokens/hr); agents that over-save enter Cognitive Debt | Resource-bounded rationality (Simon, 1955) | βœ… Shipped |
1241
1243
  | **v9.1** | Task Router v2 β€” 6-signal weighted heuristic engine routing tasks between cloud host and local LLM based on file-type complexity, scope, and multi-step detection | Heuristic classification, cognitive load theory | βœ… Shipped |
1242
1244
  | **v9.4** | Shell Injection Fix β€” `execSync` β†’ `execFileSync` + SHA format validation in git drift detection | Defense-in-depth, secure subprocess execution | βœ… Shipped |
1245
+ | **v9.4** | Command Injection Fix (lifecycle) β€” PID file injection via `execSync` template literal; remediated with `execFileSync` array args | Defense-in-depth, attack surface reduction | βœ… Shipped |
1243
1246
  | **v9.2** | Cross-Backend Reconciliation β€” automatic Supabase β†’ SQLite sync with idempotent dedup and 5s timeout | Eventual consistency, crdt-style reconciliation | βœ… Shipped |
1244
1247
  | **v9.2** | Split-Brain Drift Detection β€” dual-backend version comparison with prominent divergence warnings at load time | Byzantine fault detection, split-brain resolution | βœ… Shipped |
1245
1248
  | **v9.2** | TurboQuant QJL Validation β€” zero R@5 delta between P50 and P95 residual vectors (d=128, N=2K); CV=0.038 at d=768 proves no long tail | QJL estimator (ICLR 2026), Householder orthogonal rotation | βœ… Shipped |
package/dist/lifecycle.js CHANGED
@@ -8,7 +8,7 @@
8
8
  import * as fs from "fs";
9
9
  import * as path from "path";
10
10
  import * as os from "os";
11
- import { execSync } from "child_process";
11
+ import { execFileSync } from "child_process";
12
12
  import { closeConfigStorage } from "./storage/configStorage.js";
13
13
  import { getStorage } from "./storage/index.js";
14
14
  import { shutdownTelemetry } from "./utils/telemetry.js";
@@ -65,8 +65,12 @@ function isOrphanProcess(pid) {
65
65
  return false;
66
66
  }
67
67
  try {
68
- // 'ps -o ppid= -p PID' returns just the parent PID
69
- const ppid = execSync(`ps -o ppid= -p ${pid}`, { encoding: "utf8" }).trim();
68
+ // SECURITY: Use execFileSync (no shell) to prevent command injection.
69
+ // The PID comes from a file that could be tampered with by another process.
70
+ const ppid = execFileSync("ps", ["-o", "ppid=", "-p", String(pid)], {
71
+ encoding: "utf8",
72
+ timeout: 5000,
73
+ }).trim();
70
74
  return ppid === "1";
71
75
  }
72
76
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prism-mcp-server",
3
- "version": "9.4.3",
3
+ "version": "9.4.5",
4
4
  "mcpName": "io.github.dcostenco/prism-mcp",
5
5
  "description": "The Mind Palace for AI Agents β€” a true Cognitive Architecture with Hebbian learning (episodicβ†’semantic consolidation), ACT-R spreading activation (multi-hop causal reasoning), uncertainty-aware rejection gates (agents that know when they don't know), adversarial evaluation (anti-sycophancy), fail-closed Dark Factory pipelines, persistent memory (SQLite/Supabase), multi-agent Hivemind, time travel & visual dashboard. Zero-config local mode.",
6
6
  "module": "index.ts",
@@ -94,6 +94,7 @@
94
94
  "@types/jsdom": "^28.0.1",
95
95
  "@types/mozilla-readability": "^0.2.1",
96
96
  "@types/turndown": "^5.0.6",
97
+ "dotenv": "^17.4.2",
97
98
  "tsx": "^4.19.3",
98
99
  "vitest": "^4.1.1"
99
100
  },
@@ -102,7 +103,6 @@
102
103
  },
103
104
  "dependencies": {
104
105
  "@anthropic-ai/sdk": "^0.81.0",
105
- "@google-cloud/discoveryengine": "^2.5.3",
106
106
  "@google/generative-ai": "^0.24.1",
107
107
  "@libsql/client": "^0.17.2",
108
108
  "@modelcontextprotocol/sdk": "^1.27.1",
@@ -116,7 +116,6 @@
116
116
  "@tavily/core": "^0.6.0",
117
117
  "cheerio": "^1.2.0",
118
118
  "commander": "^14.0.3",
119
- "dotenv": "^16.5.0",
120
119
  "fflate": "^0.8.2",
121
120
  "jose": "^6.2.2",
122
121
  "jsdom": "^29.0.1",