mirror of
https://github.com/rohitg00/agentmemory.git
synced 2026-09-14 20:16:33 +08:00
cbaaf4fb44
Fixes 6 security issues in agentmemory's default deployment, viewer, mesh sync, export path, and startup flow. ## Findings Addressed 1. **Default REST/stream exposure on 0.0.0.0** — bind default REST and stream services to 127.0.0.1; restrict Docker port publishing to localhost; add dedicated iii-config.docker.yaml for Docker usage. 2. **Stored XSS via inline viewer handlers** — remove inline event handlers from the viewer; replace with delegated data-action event handling; switch to nonce-based CSP for viewer HTML; add script-src-attr 'none'. 3. **Arbitrary path writes in Obsidian export** — confine exports to AGENTMEMORY_EXPORT_ROOT (default ~/.agentmemory); reject vaultDir values outside the allowed root. 4. **Mesh sync without peer auth** — require AGENTMEMORY_SECRET for mesh endpoints and sync operations; send Authorization: Bearer <secret> on mesh push/pull requests. 5. **Secret redaction misses modern token formats** — add coverage for Bearer tokens, sk-proj-*, broader sk/pk/rk/ak variants, GitHub ghs_/ghu_ tokens. 6. **CLI executes remote shell script directly** — remove curl|sh installation pattern; use existing local iii-engine binary if available, otherwise fall back to Docker. ## Validation - 654 tests passing (8 new security tests) - npm run build succeeds - Merged with main and resolved README conflicts to preserve the new benchmark/competitor table layout Thanks @eng-pf for catching these and submitting the fixes.
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
modules:
|
|
- class: modules::state::StateModule
|
|
config:
|
|
adapter:
|
|
class: modules::state::adapters::KvStore
|
|
config:
|
|
store_method: file_based
|
|
file_path: ./data/state_store.db
|
|
|
|
- class: modules::api::RestApiModule
|
|
config:
|
|
port: 3111
|
|
host: 0.0.0.0
|
|
default_timeout: 180000
|
|
cors:
|
|
allowed_origins: ["http://localhost:3111", "http://localhost:3113", "http://127.0.0.1:3111", "http://127.0.0.1:3113"]
|
|
allowed_methods: [GET, POST, PUT, DELETE, OPTIONS]
|
|
|
|
- class: modules::queue::QueueModule
|
|
config:
|
|
adapter:
|
|
class: modules::queue::BuiltinQueueAdapter
|
|
|
|
- class: modules::pubsub::PubSubModule
|
|
config:
|
|
adapter:
|
|
class: modules::pubsub::LocalAdapter
|
|
|
|
- class: modules::cron::CronModule
|
|
config:
|
|
adapter:
|
|
class: modules::cron::KvCronAdapter
|
|
|
|
- class: modules::stream::StreamModule
|
|
config:
|
|
port: 3112
|
|
host: 0.0.0.0
|
|
|
|
- class: modules::observability::OtelModule
|
|
config:
|
|
enabled: true
|
|
service_name: agentmemory
|
|
exporter: memory
|
|
logs_enabled: true
|
|
|
|
- class: modules::shell::ExecModule
|
|
config:
|
|
watch:
|
|
- src/**/*.ts
|
|
exec:
|
|
- node dist/index.mjs
|