Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

docs: document in-memory credential security model (#2359)

LearningCircuitabd3a69e175a
diff --git a/README.md b/README.md
index cbe88c30f7..243d7e70f8 100644
--- a/README.md
+++ b/README.md
@@ -152,6 +152,8 @@ flowchart LR
Your data stays yours. Each user gets their own isolated SQLCipher database encrypted with AES-256 (Signal-level security). No password recovery means true zero-knowledge—even server admins can't read your data. Run fully local with Ollama + SearXNG and nothing ever leaves your machine.
+**In-memory credentials**: Like all applications that use secrets at runtime — including [password managers](https://www.ise.io/casestudies/password-manager-hacking/), browsers, and API clients — credentials are held in plain text in process memory during active sessions. This is an [industry-wide accepted reality](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html), not specific to LDR: if an attacker can read process memory, they can also read any in-process decryption key. We mitigate this with encrypted swap prevention (`mlock`), session-scoped credential lifetimes, and SQLCipher's `cipher_memory_security` (which zeros database key material after use). Ideas for further improvements are always welcome via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues). See our [Security Policy](SECURITY.md) for details.
+
**Supply Chain Security**: Docker images are signed with [Cosign](https://github.com/sigstore/cosign), include SLSA provenance attestations, and attach SBOMs. Verify with:
```bash
cosign verify localdeepresearch/local-deep-research:latest
diff --git a/SECURITY.md b/SECURITY.md
index d92dc2b3e9..a714e9cf61 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -56,6 +56,24 @@ This project processes user queries and search results. Key areas:
- **Search data** - Queries are processed locally when possible
- **Dependencies** - Regularly updated via automated scanning
+### Data at Rest
+
+User passwords are never stored directly — each user's password serves as the encryption key for their personal SQLCipher database (AES-256, PBKDF2-HMAC-SHA512 with 256,000 iterations and per-user salt). API keys are stored inside these encrypted databases.
+
+### In-Memory Credentials
+
+Like all applications that use secrets at runtime, credentials are held in plain text in process memory during active sessions. This is an industry-wide reality acknowledged by [OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html), [Microsoft](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-security-securestring) (who deprecated `SecureString` for this reason), and the [pyca/cryptography](https://cryptography.io/en/stable/limitations/) library. Independent research has shown that even dedicated security software like [password managers](https://www.ise.io/casestudies/password-manager-hacking/) cannot fully prevent secrets from residing in memory.
+
+**Why in-process encryption does not help:** If an attacker can read process memory, they can also read any decryption key stored in the same process. As OWASP notes, for most server-side applications the cost of defending against memory-level attacks far exceeds the likely impact.
+
+**What we do to mitigate:**
+- SQLCipher's `cipher_memory_security` zeros database key material after use
+- `mlock` prevents credential pages from being swapped to disk
+- Session-scoped credential lifetimes with automatic expiration
+- Core dump exclusion via container security settings
+
+Ideas for further improvements are always welcome via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues).
+
## Supported Versions
Security fixes are only provided for the latest release. Please upgrade to receive patches.