Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Merge remote-tracking branch 'origin/main' into claim/issue-2518
Adam Eivy9a904f716d0f
diff --cc .changelog/NEXT.mdindex 7b55bfd820,8023763a8a..cafbaf7230--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@@ -3,7 -3,8 +3,9 @@@## Security- **[issue-2514] Harden AI provider custom endpoints against SSRF / API-key exfiltration.** A provider's `endpoint` is a free-form URL, and model-refresh / API-run paths attached the paid `Authorization: Bearer <apiKey>` and fetched that host with no host checks — a hostile or mistyped endpoint could receive the user's paid LLM key and prompts, or be pointed at a cloud-metadata service (`169.254.169.254`). A new `endpointGuard` now gates every secret-bearing request: loopback/LAN (Tailscale) and known paid-provider hosts are allowed, cloud-metadata hosts are always blocked, and any other host requires the new per-provider **Allow custom endpoint** opt-in. Keyless local-LLM calls (Ollama/LM Studio) are unaffected.+- **[issue-2518] Harden upload path containment and stop leaking absolute FS paths.** The upload/attachment/screenshot routes guarded writes with a bare `resolvedPath.startsWith(DIR)` (no trailing separator, so a sibling like `data/uploads-evil/` string-matched) and the attachment/screenshot responses echoed the absolute on-disk `path` back to the client, leaking the install layout / home-directory username segment. Containment now goes through a shared `isPathInsideDir()` helper (anchored `resolvePath(dir) + sep` prefix, matching `makePathResolver`), responses return only API-relative URLs (`/api/screenshots/<file>`), and the CoS prompt builder resolves those refs back to absolute paths at render time (legacy absolute values pass through unchanged). The `moltbook-claim.mjs` script now logs only the token length + short prefix instead of the full bearer token.+ - **[issue-2517] Revalidate the browser navigate URL by resolved IP and by Chrome's actual per-hop connect address.** `POST /api/browser/navigate` only checked the host LITERAL with `isSafeIngestUrl`, so a hostname whose A record rebinds to loopback/link-local/cloud-metadata, or a post-navigate redirect the CDP browser silently follows to a blocked host, slipped past. The route now adds a DNS-resolve pre-check (`assertPublicHttpUrl`) that refuses a hostname resolving to a blocked address before any tab is opened, and drives the navigation through `navigateToUrlPinned` — the same connect-time pin the catalog URL ingest uses — which verifies Chrome's own reported `remoteIPAddress` for the initial nav, every HTTP redirect, and any client-side navigation in the settle window, tearing the tab down and failing closed on a blocked hop. LAN/Tailscale hosts stay intentionally allowed. Residual: a WebSocket to a hostname that DNS-rebinds to a private IP can't be pinned via CDP interception (no `remoteIPAddress` on WS events) — bounded by the single-user trust model and documented in `browserService.ssrfPinRefusalReason`.+ - **[issue-2515] Restrict Layered Intelligence custom `cmd` sources to allowlisted binaries (no `shell: true`).** A custom `cmd` source ran its full command string through `shell: true` with only a length/timeout cap, so any config-write path (hand edit, hostile sync payload) gained persistent, unattended RCE on the LI schedule (`; rm -rf ~`, `$(curl … | sh)`, pipes to `sh`). `runShellCommand` now denies the shell by default: the command is parsed and checked against the shared `commandSecurity` binary allowlist (rejecting shell metacharacters and non-allowlisted binaries), then spawned with `shell: false` and parsed args. An operator who genuinely needs a pipeline can set the install-level `settings.layeredIntelligence.trustShellSources` opt-in (off by default) to restore full-shell behavior for that install only.## Fixed