| Version | Supported |
|---|---|
main |
Security fixes target this branch. It may be newer than the public installer. |
Public 0.2.x and earlier |
Unsupported. |
The first supported public desktop release will be identified in its release notes. Use the private reporting channel below if you are unsure whether an installed build is affected.
REALM Knowledge Engine is designed as a local-first desktop / single-node application with an optional stateless read-only Public API (REALM_MODE=public):
- Strict Local-Only Lock (Default ON): Blocks server-side cloud LLM, cloud embeddings, cloud model discovery, cloud TTS, browser dictation, opt-in web search, web clipping, SEO live fetches, Built-In Browser navigation, External A2A peer calls, remote HTTP MCP Client calls, and Telegram Channels polling/replies (
403). Enforces loopback-onlyOLLAMA_HOST(unlessREALM_ALLOW_REMOTE_OLLAMA=1) and allows loopback Custom OpenAI-Compatible Endpoints (127.0.0.1/localhost, e.g., LM Studio / local vLLM) while blocking remote custom gateways unless unlocked or explicitly allowed by IT policy. - Optional Admin Policy Lock (
policy.json/REALM_POLICY_PATH): Invisible unless deployed. Lets organizations enforce Strict Local-Only Lock, disable selected opt-in modules (e.g.,health_vitality,channels_bridge), cap maximum REALM Autonomy ceilings, restrict allowed LLM providers, or pin an approved corporate OpenAI-compatible gateway. - Append-Only Structured Audit Trail (
<data_dir>/logs/audit.jsonl,0600): Records secret-scrubbed UTC JSONL events for AI queries (withexternal_egressflag), Autonomy Tier patches, Tier 3 outbound actions, policy blocks, PII scrubs, and backups, exportable as JSONL or formula-safe CSV. - Localhost Defense-in-Depth & Scoped HTTPS Companion (
core/http_guard.py,core/companion.py): Desktop and CLI local admin listeners bind strictly to127.0.0.1(non-loopback CLI binds require explicitREALM_ALLOW_NON_LOOPBACK=1), verify the peer socket address authoritatively (non-loopback peers can never spoof a loopbackHost, and local admin routes reject forwarded proxy headers), reject duplicate security/forwarding headers (400), enforce same-originOrigin/Referer/Sec-Fetch-Siteand Content-Type guards on mutations, block cross-siteGETrequests to/api/*and/v1/*, and attach strict CSP,CORP,COOP,Cache-Control: no-store, andHSTSover HTTPS. Opt-in Mobile Companion requires HTTPS (REALM_COMPANION_PUBLIC_URL=https://...orREALM_COMPANION_TLS_CERT+REALM_COMPANION_TLS_KEY), enforces a strict 4-endpoint default-deny allowlist (GET /api/memory,POST /api/channels/capture, read-onlyGET /api/search,GET /api/social), and uses server-enforced expiring signedv2Secure; HttpOnly; SameSite=Strictcookies with per-session logout revocation. - SSRF, Isolated Browser, Vault Autofill & File Boundaries (
core/net_security.py,core/vault_origin.py,features/programming/api_lab_net.py,core/file_types.py): Outbound fetches and API Lab requests disable implicit redirects and proxy env leaks (follow_redirects=False,trust_env=False), resolve DNS per hop, reject cloud-metadata/link-local/multicast/CGNAT/NAT64/unspecified (0.0.0.0) targets, and pin connections per hop. Built-In Browser uses a dedicated Electron companion with no debugging listener. Each session has a browser-process proxy preference that is reapplied when the network service recreates its context. Standard tabs share the public relay. Private tabs get ephemeral cookie storage, and development previews use a relay restricted to the selected loopback destination. Renderers run sandboxed with Node integration disabled. REALM checks each relay before opening user pages. Chromium site sign-ins last for the browser session. Development previews use a separate ephemeral context, restricted to the exact loopback destination chosen during a manual action. Session restore grants public browsing only. The macOS desktop window still uses WebKit for REALM itself. Autofill enforces exact canonical(scheme, host, port)origin checks both server-side and inside the live page before autofilling saved logins (HTTPS required outside loopback). Vault reads/writes enforce canonical path containment (O_NOFOLLOW), reserved system directories (REALM_RESERVED_ROOT_DIRS), ignored secrets/build folders, and bounded archive/XML/upload limits. Windows containment walks local-drive paths one component at a time and checks each opened handle before enumeration or reading. Junctions, cloud placeholder reparse points, and remote drives are excluded. - Public Mode Proxy Trust & Shared Quota Store (
features/ui/public_proxy.py,core/public_quota_store.py): UnderREALM_MODE=public,X-Forwarded-Foris honored ONLY from exact loopback or explicitly allowlistedREALM_PUBLIC_TRUSTED_PROXIESIPs/CIDRs (never blanket RFC 1918), and per-IP/global daily request and USD caps are enforced atomically across restarts and local workers via0600SQLite (REALM_PUBLIC_QUOTA_DB, or<data_dir>/.public_quota.sqlite3). If the SQLite quota store is unavailable, paid AI/embedding calls fail closed to$0search-only (quota_scope: "fail_closed_search_only") unless single-worker ephemeral in-memory limits are explicitly opted in viaREALM_PUBLIC_ALLOW_MEMORY_QUOTA=1. Workers independently limit anonymous request admission before catalog or retrieval work. Published lexical statistics are prepared once per snapshot. Multi-host deployments should also use provider-side spend caps and a shared ingress rate limit. - Secret Handling & Destination-Bound Placeholders (
core/secrets.py,core/secret_broker.py): Saved API keys (secrets.json), channel tokens (.channels_secrets.json), and destination-bound placeholder secrets (.bound_secrets.json, managed via local-only/api/secrets/bound) live in0600owner-only storage, are excluded from ZIP backups, Blueprint Packs, RAG indexing, and diagnostics, are never echoed back in plaintext, and are scrubbed from error responses and logs. Bound placeholders ({{secret:<slug>}}) bind each secret to an exact canonical(scheme, host, port)origin (https://required outside explicit loopback), inject only at outbound egress in API Lab headers/body and HTTP MCP configs, fail closed withPermissionError+secret_broker_deniedaudit logs on any origin mismatch, are rejected in request URLs,stdioMCP servers, and workflow web/social nodes, stay unexpanded in exportedcurlcommands, and are redacted if echoed back in responses or errors. Import and snapshot creation reject recognizable credential documents, including legacy Markdown conversions that preserve credential filenames or provider stores. Previously published data requires separate incident review. - Agent Harness Safety, Pre-Tool Checkpointing, Idempotency & Opt-In Sandbox (
core/idempotency.py,core/sandbox_driver.py,core/spec_verifier.py): Agent Mode writes a0600atomic pre-tool checkpoint (cp_<run_id>.json) before mutating workspace files, and deduplicates approved MCP/workflow actions via a0600bounded.idempotency_ledger.json(excluded from indexing and backups) so retries do not double-execute side effects. Verification commands default to host execution (sandbox_mode: "off"); when explicitly opted intodocker/sbx(auto,docker, orsbx), REALM runs checks with--network=none,--read-only,--cap-drop=ALL,--security-opt=no-new-privileges, bounded--pids-limit/--memory/--cpus, safe workspace mount checks, fail-closed refusal if the runtime is unavailable (never silently falling back to the host), and forced container cleanup on timeout and app shutdown. Independent Spec Verification checksREQ-*test traceability with traversal-safe path checks and evaluates diffs in an isolated read-only pass with XML-escaped untrusted requirement and diff blocks. - Supply Chain Integrity: CI audits locked dependencies with
pip-auditand uses read-only repository permissions and commit-pinned Actions. The Windows workflow stages unsigned test builds. The owner approves publication of verified installers,SHA256SUMS.txt, and a CycloneDX SBOM. Apple signing credentials stay on a trusted Mac. Release and code-signing guide - Desktop Update Discovery: A local user initiates each check. The server checks workspace and admin policy, then contacts one fixed public GitHub endpoint over HTTPS without redirects, proxy environment settings, or account and workspace data. The request is time- and size-bounded. GitHub controls the release metadata. REALM uses a stable tag, immutable release status, installer filename, architecture, minimum OS label, and published checksum metadata to decide which official link to display. The browser handles the requested download. The operating system handles installer signature enforcement, and release operators verify signatures before publication.
See docs/PRIVACY_AND_COMPLIANCE.md and NOTICE for full security architecture, compliance boundaries, and disclaimers.
- A local listener must authenticate access to administrative actions and verify ownership of the server before opening the desktop UI. A loopback address is shared by local accounts. Mobile Companion and the Public API have separate, narrower authority.
- Opening or importing a document, project, backup, skill, or workflow grants no new permissions. Treat their contents as untrusted data. Enforce current user consent and administrative restrictions where processes, tools, scheduled jobs, file changes, and external calls execute.
- For actions that can expose data, spend money, change files, or affect external systems, show the actual scope, destination, and effect in the user approval. Bind approval to the exact action and invalidate it when an input, target, or permission changes. Limit process arguments, permissions, environment, and lifetime at launch. Require explicit user action to grant more access.
- External reads and writes require permitted destinations. Keep credentials bound to the destination they were supplied for. Preserve Local-Only Lock across startup, fallback, redirects, and background work.
- Public responses may contain only explicitly published content that passes the current exclusions. Apply secret and path checks before reading and publishing. Preserve exclusions on errors and prevent stale indexes from restoring access.
- Bound network responses, imports, queues, and parser work before buffering or expansion. Keep revocation, quotas, and authorization effective across retries, restarts, and concurrent operations.
- Default to the user's account and narrowly scoped OS permissions. Retain secrets and sensitive data only where needed. Keep diagnostics free of credentials and unnecessary user content. Test retention, deletion, and recovery when changing backup, migration, or account boundaries.
Changes at these boundaries require tests for denied and legitimate use. A passing suite, a signed build, and a review of the exact candidate establish different parts of release readiness. See the repository's security change and release gates.
- Keep resource-intensive work opt-in. Use available RAM and CPU capacity to choose conservative defaults for local inference and leave headroom for the rest of the machine. Limit concurrent expensive work and queued jobs. Release idle subprocesses and their memory. Leave foreground applications responsive and preserve OS power management and thermal protections.
- Budget time, network bytes, temporary and unpacked storage, memory, and output before allocating them. Check disk capacity at the download and extraction stages. On rejection, cancellation, or shutdown, clean up temporary work or keep only bounded data needed to safely resume. Be explicit about what failed and how the user can recover.
- For resource-sensitive changes, compare startup or idle use, ordinary work, and limit-hit behavior on representative hardware. Record the device, workload, latency, CPU and memory peaks, and relevant GPU, power, disk, or network observations. Check that work stops and resources are released on cancellation and exit. Exercise low-space and low-memory behavior with synthetic fixtures where possible.
Exercise OS-specific controls on every platform receiving an installer. Verify native filesystem containment and install/uninstall on Windows, and signing and Gatekeeper on macOS. When browser egress or policies change, verify the packaged browser behavior, including policy refresh and network-service recreation. Managed deployments that require the organization's browser proxy still need an egress design that satisfies that requirement. Record gaps privately and hold affected assets when a required check is missing or a significant risk remains. Use the release evidence checklist.
Please do not report security vulnerabilities in public GitHub issues.
- Use GitHub Private Vulnerability Reporting on this repository (Security → Advisories → Report a vulnerability).
- Include a clear description of the issue, affected component/version, reproduction steps or proof-of-concept, and any suggested mitigation.
- Expect an acknowledgement within 72 hours and a remediation timeline once reproduced. Coordinated disclosure will credit reporters unless anonymity is requested.