Skip to content

Commit c4c9729

Browse files
committed
fix: security, config merge, docs accuracy, license (v0.9.5)
- Fix timing leak in safeCompare (pad to equal length) - Fix loadConfig shallow merge → deepMerge for env overrides - Fix PLUGIN_VERSION to match package version - Fix README: Node.js >= 20, remove speculative models, add cortex_relations - Add MIT LICENSE file - Update CHANGELOG with dates and v0.9.3 entry - Bump cortex-bridge to v0.6.2
1 parent dd6aca9 commit c4c9729

8 files changed

Lines changed: 54 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Changelog
22

3-
## v0.9.4
3+
## v0.9.5 — 2026-03-21
4+
5+
### Fixes
6+
- **Timing leak in safeCompare**: Pad both strings to equal length before constant-time comparison, preventing length-based timing attacks.
7+
- **Deep merge for env overrides in loadConfig**: Use `deepMerge` instead of shallow spread so env var overrides (e.g. `CORTEX_DB_PATH`) don't clobber nested file config.
8+
- **PLUGIN_VERSION**: Corrected cortex-bridge version from 0.5.1 to 0.6.1.
9+
- **README accuracy**: Fixed Node.js requirement (≥ 20), removed speculative model names, added `cortex_relations` to MCP tools table, fixed `pnpm start``pnpm dev`.
10+
- **CHANGELOG**: Added missing v0.9.3 entry and dates.
11+
- **LICENSE**: Added MIT license file.
12+
13+
## v0.9.4 — 2026-03-15
414

515
### Features
616
- **Multi-agent tool isolation**: Bridge tools (`cortex_recall`, `cortex_remember`, `cortex_ingest`) now accept an optional `agent_id` parameter, enabling per-request agent switching in multi-agent orchestrators.
@@ -14,15 +24,19 @@
1424
### Fixes
1525
- Fixed version display endpoint to return correct version string.
1626

17-
## v0.9.2
27+
## v0.9.3 — 2026-03-10
28+
29+
- Bump cortex-bridge to v0.6.1 for npm publish.
30+
31+
## v0.9.2 — 2026-03-08
1832

1933
- Use `config.storage.dbPath` instead of non-existent `config.dataDir` in `backupDb()`.
2034

21-
## v0.9.1
35+
## v0.9.1 — 2026-03-05
2236

2337
- Bump `@cortexmem/mcp` to 0.1.2 with auth-token support.
2438

25-
## v0.9.0
39+
## v0.9.0 — 2026-03-01
2640

2741
- Broaden fast channel coverage for diverse users.
2842
- Comprehensive fast channel and prompt audit.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 rigouu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ git clone https://github.com/rikouu/cortex.git
248248
cd cortex
249249
pnpm install
250250
pnpm build # Build server + dashboard
251-
pnpm start # → http://localhost:21100
251+
pnpm dev # → http://localhost:21100
252252
```
253253

254254
**Development mode** (for contributors):
@@ -261,7 +261,7 @@ cd packages/dashboard && pnpm dev # → http://localhost:5173
261261

262262
> ⚠️ In dev mode, visiting `http://localhost:21100` in browser will show a 404 — that's normal. The Dashboard dev server runs on a separate port.
263263
264-
**Requirements:** Node.js ≥ 18, pnpm ≥ 8
264+
**Requirements:** Node.js ≥ 20, pnpm ≥ 8
265265

266266
</details>
267267

@@ -535,6 +535,7 @@ curl -X POST http://localhost:21100/api/v1/ingest \
535535
|---|---|
536536
| `cortex_recall` | Search memories with priority injection |
537537
| `cortex_remember` | Store a specific memory |
538+
| `cortex_relations` | List entity relationships from memory |
538539
| `cortex_forget` | Remove or correct a memory |
539540
| `cortex_search_debug` | Debug search scoring |
540541
| `cortex_stats` | Memory statistics |
@@ -547,10 +548,10 @@ curl -X POST http://localhost:21100/api/v1/ingest \
547548

548549
| Provider | Recommended Models | Notes |
549550
|---|---|---|
550-
| **OpenAI** | gpt-4o-mini, gpt-5.2 | Default. Best cost/quality |
551+
| **OpenAI** | gpt-4o-mini, gpt-4o | Default. Best cost/quality |
551552
| **Anthropic** | claude-haiku-4-5, claude-sonnet-4-6 | Highest extraction quality |
552553
| **Google Gemini** | gemini-2.5-flash | Free tier on AI Studio |
553-
| **DeepSeek** | deepseek-chat, deepseek-v4 | Cheapest option |
554+
| **DeepSeek** | deepseek-chat | Cheapest option |
554555
| **DashScope** | qwen-plus, qwen-turbo | 通义千问, OpenAI-compatible |
555556
| **Ollama** | qwen2.5, llama3.2 | Fully local, zero cost |
556557
| **OpenRouter** | Any of 100+ models | Unified gateway |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cortex",
33
"private": true,
4-
"version": "0.9.4",
4+
"version": "0.9.5",
55
"description": "Cortex - Universal AI Agent Memory Service",
66
"scripts": {
77
"dev": "pnpm --filter @cortex/server dev",

packages/cortex-bridge/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cortexmem/openclaw",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"type": "module",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

packages/cortex-bridge/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
// ── Plugin version ──────────────────────────────────────
12-
const PLUGIN_VERSION = '0.5.1';
12+
const PLUGIN_VERSION = '0.6.2';
1313

1414
// ── Timeouts ────────────────────────────────────────────
1515
const RECALL_TIMEOUT = 8000;

packages/server/src/api/security.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ const log = createLogger('security');
77

88
/** Timing-safe string comparison to prevent timing attacks */
99
function safeCompare(a: string, b: string): boolean {
10-
if (a.length !== b.length) return false;
11-
return timingSafeEqual(Buffer.from(a), Buffer.from(b));
10+
const maxLen = Math.max(a.length, b.length);
11+
const bufA = Buffer.alloc(maxLen, 0);
12+
const bufB = Buffer.alloc(maxLen, 0);
13+
Buffer.from(a).copy(bufA);
14+
Buffer.from(b).copy(bufB);
15+
return a.length === b.length && timingSafeEqual(bufA, bufB);
1216
}
1317

1418
/** Check if the active token comes from env var (immutable from Dashboard) */

packages/server/src/utils/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export function loadConfig(overrides?: Partial<CortexConfig>): CortexConfig {
191191
}
192192

193193
// 3. Merge and validate
194-
const merged = { ...fileConfig, ...envOverrides, ...overrides };
194+
const merged = deepMerge(deepMerge(fileConfig, envOverrides), overrides || {});
195195
_config = CortexConfigSchema.parse(merged);
196196
return _config;
197197
}

0 commit comments

Comments
 (0)