Please report security problems privately through GitHub's Security → Report a vulnerability on this repository, not in a public issue. Include the affected file and line, the platform and steps to reproduce.
The native-stdio security migration is implemented in this source tree, but it has not
been applied to a production installation. An older installed setup may still have
keyless QMD and LongMemory HTTP listeners until the user approves and completes
node scripts/ensure.mjs --apply. --plan and --check are read-only; they do not stop
legacy listeners. Do not describe an existing installation as remediated until apply
reports success and the connected agents use the migrated configuration.
--check is offline: it uses local state and local probes only. --plan, --apply and
--update also resolve LongMemory's refs/heads/main with git ls-remote (30 s timeout);
--plan and --check never modify files or services. A --plan can report local health
endpoints for a legacy setup; this is not an external network request. --update builds
and switches LongMemory to the resolved main when it is not the running build. It does
not refresh other packages or replace the full --apply migration. Use it only after
--apply completes initial setup or agent-configuration repair. Before writing, it blocks
when private storage or the native launcher is unavailable, or the setup-owned legacy
LongMemory service remains. Once those preconditions hold, it changes only the LongMemory
build and leaves agent configurations and service registrations unchanged. Its ready
result means that LongMemory build was updated; it does not certify full setup readiness.
- QMD and LongMemory are native stdio MCP child processes, each started by an agent's
managed client configuration when that agent connects. The configuration passes the
pinned Node executable, the setup launcher, the server name and the private runtime
record path. The launcher selects the recorded executables, clears inherited QMD,
LongMemory, OpenMemory, index and Ollama host overrides plus
NODE_OPTIONSandNODE_PATH, and applies private storage permissions before spawning the server. Their memory requests travel over the agent-owned pipes; the managed design creates no shared QMD or LongMemory HTTP listener. - The LongMemory launcher uses the upstream native
create_stdio_mcptransport with the default tenant/user andproject_id: null. This preserves the prior shared memory scope across projects instead of inheriting the CLImcpcommand's working-directory project scope. MCP initialization andtools/listalone do not prove write/recall compatibility across directories. - Ollama remains available at
127.0.0.1:11434for embedding requests. This endpoint is local and is not the agent-to-memory transport. The LongMemory launcher waits for the selected model to appear in Ollama before starting the stdio process. - Apply migrates only the recognized legacy agent HTTP entries and retires setup-owned QMD/LongMemory service registrations. It backs up each changed agent configuration and owned service file before writing or retiring it. Custom or foreign MCP definitions, foreign service registrations and unmanaged memory listeners that conflict with the migration are preserved and block the affected work; the setup does not overwrite, adopt or stop them.
- Memory storage is restricted to the current user's access where the platform's permission model supports it. Startup also sets a restrictive process umask and revalidates the protected paths. Existing database contents are retained; setup does not delete the LongMemory database.
- On Windows, setup builds one protected descriptor for the current user and applies it
with a single
Set-Aclcall, then verifies the resulting ACL. It does not reset access withicacls /resetbefore granting access again.
- QMD is pinned to
@tobilu/qmd2.8.3 independencies/qmd/package.jsonand its committed npm lockfile, installed withnpm ci. - LongMemory follows the latest
mainofhttps://github.com/CaviraOSS/LongMemory.git. Each build fetches exactly the resolved commit.dependencies/longmemory/holds a reviewed root-only manifest and lockfile for the baseline commit9ee2c8e1ed42d83eb788afb9ffc3a82b84405da5(LONGMEMORY_COMMIT); whenmainis that commit,npm ciinstalls that committed lock. The upstream baseline's root graph listed 35 vulnerable paths; the reviewed lock closes them, andnpm audit --omit=devon it reported no production advisories. - When
mainis any other commit, setup derives the root-only manifest the same way in code (scripts/longmemory_dependencies.mjs): upstream's name, version, license, engines, module fields andbuildscript, with every direct dependency pinned to the version upstream'spnpm-lock.yamlroot importer resolved. Upstream overrides, a lockfile that disagrees withpackage.json, or a non-registry version stop the update.npm install --package-lock-only --ignore-scriptsthen resolves a fresh lock in the candidate checkout, andnpm audit --omit=dev --jsonchecks it. Any high or critical production advisory blocks the update: the step fails naming the commit and advisories, nothing is installed, and the running build stays current. Moderate and lower advisories are recorded but do not block. Only a passing graph is installed withnpm ciand built. Setup never bootstraps pnpm or installs the upstream workspace. - The generated manifest and lock stay at the root of that build directory, where
npm ciread them. The build receipt records the commit, the manifest/lock fingerprint, the lock's SHA-256, the production audit counts and an artifact fingerprint of the tracked source, generated output, LongMemory stdio bootstrap and npm's hidden.package-lock.json. The receipt must match after the smoke test, on reuse and whenever a build is reported current; a newer commit's build counts only with a recorded passing audit. The receipt detects source/output/lock-resolution drift; it is not a byte-level authenticity check for every file undernode_modules. - Following
maintrusts upstream's source at that commit, as any build of it would. The audit gate covers published dependency advisories; it does not review upstream code.
Retrieval remains CPU-only. The managed QMD environment uses Metal for qmd embed on
Apple Silicon and Vulkan elsewhere; this policy does not move Ollama or the memory MCP
processes onto a GPU transport.
Before changing an agent configuration or retiring a setup-owned legacy service,
--apply writes the exact prior file bytes to a hash-named backup in the private
~/.config/local-memory-setup/backups/ directory. If a custom or foreign definition or
service blocks the plan, resolve it explicitly; do not remove the blocker by replacing
that configuration with a generated one.
LongMemory builds live separately from the database under
~/.local/share/local-memory-setup/longmemory/builds/. The candidate build and its stdio
smoke test must pass before the current pointer changes. The previously current build is
retained as the previous build for rollback; a later update may prune older builds. The database at ~/.local/share/local-memory-setup/longmemory.db is outside the
build tree and is not deleted by migration or rollback.
There is no automatic configuration rollback. To roll back a completed migration, restore the relevant configuration or service file from its matching backup, select a still-retained previous LongMemory build, then restart the affected agent so it recreates its client process. Restoring a legacy HTTP service also restores its former exposure; only do that deliberately and keep the database's private permissions. Preserve the previous build and backups until rollback is no longer required. A source-only revert does not reverse installed agent or service configuration.
The implementation work has not performed a production apply or a full end-to-end validation on every supported operating system. Platform-specific logic and isolated tests are not evidence that every operating-system migration path has been exercised.
On Linux, setup may run sudo -n (never an interactive prompt) to run the pinned Ollama
installer, enable Ollama's service or enable systemd linger. When a password would be
needed, it stops and prints the exact command for the user. The Ollama installer is
downloaded from the release tag matching the pinned version and checked against a pinned
SHA-256 before execution.
The LongMemory database is stored at
~/.local/share/local-memory-setup/longmemory.db; QMD indexes only the folders selected
by the user. Setup downloads software and models to the machine. Never store
secrets or .env contents in indexed folders or memory.