@mingxy/cerebro 1.17.0 → 1.17.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
4
4
  "description": "Cerebro persistent memory plugin for OpenCode — auto-recall, auto-capture, 9 memory tools with clustering, project-scoped memory isolation",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/web-server.ts CHANGED
@@ -44,7 +44,9 @@ function getMimeType(ext: string): string {
44
44
  // ── Safe path resolver (prevent traversal) ───────────────────────────────
45
45
 
46
46
  function resolveSafe(baseDir: string, pathname: string): string | null {
47
- const resolved = path.resolve(baseDir, pathname);
47
+ // Strip leading slash so path.resolve treats it as relative
48
+ const relative = pathname.startsWith("/") ? pathname.slice(1) : pathname;
49
+ const resolved = path.resolve(baseDir, relative || ".");
48
50
  if (!resolved.startsWith(baseDir + path.sep) && resolved !== baseDir) {
49
51
  return null;
50
52
  }