Aristotele runs a local HTTP/1.1 Studio & API server (127.0.0.1:1337), persistent personal memory (~/.aristotele), provider subprocess transports (curl / CLI bridges), and workspace MCP tools behind capability rungs (Rung0..=Rung3) and SPHIST/1 MAC-authenticated logs.
A local AI assistant faces seven primary attack surfaces:
- Browser Cross-Origin / DNS Rebinding / CSRF against
127.0.0.1:1337 - Stored DOM XSS inside Studio chat/memory/connector panels
- Credential / API key exposure in process arguments (
ps) or unsafe CLI bridges - Unbounded TCP thread spawning & HTTP request smuggling
- Symlink escapes, oversized reads, and policy bypasses in workspace/connector tools
- Weak key derivation or non-atomic config/state writes
- Unvalidated control characters or out-of-range fields in settings payloads
| ID | Surface | Fix Implemented | Location |
|---|---|---|---|
| SEC-01 | DNS rebinding & wildcard CORS/CSRF (127.0.0.1:1337) |
Removed Access-Control-Allow-Origin: *. Added strict loopback Host header check (403 on non-loopback), Sec-Fetch-Site: cross-site rejection (403), validated loopback Origin reflection, and per-runtime 256-bit X-Aristotele-Token CSRF validation (ct_eq_str) on browser POST mutations. |
server.rs, http.rs |
| SEC-02 | Stored DOM XSS & unsafe media URIs | Strengthened esc() (& < > " ' \ /), replaced all dynamic string interpolations in onclick/onchangehandlers withdata-*attributes and delegated event listeners, and restricted chat media attachments viasafeMediaMime()/safeImageUrl()`. |
webapp.rs |
| SEC-03 | API key exposure in curl argv & unconstrained cli: bridges |
curl_post_json enforces --proto =https, --max-filesize 8388608, CR/LF/NUL/whitespace validation, and passes sensitive headers via an RAII 0600 temp --config file. query_cli_bridge restricts cli: binaries to ["claude", "gemini", "codex", "ollama"] and blocks NUL / leading-- model flag injection. |
providers.rs |
| SEC-04 | Unbounded accept threads, HTTP smuggling & header injection | Capped concurrent HTTP worker threads at MAX_CONCURRENT_HTTP = 64 (503 Service Unavailable when saturated), rejected duplicate Content-Length and inbound Transfer-Encoding headers, sanitized CRLF response headers, added X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: no-referrer, Cache-Control, and strict HTML CSP, and bounded CoopOpenAiClient response reads to 8 MiB. |
http.rs, server.rs |
| SEC-05 | Symlink traversal, oversized file reads & connector policy bypasses | Skipped symlinks explicitly in collect_tree and search_dir, enforced MAX_READ_FILE_BYTES = 4 MiB on read_file, blocked flag injection (-) in crabcc_query, expanded PolicyConfig default blocklist with shells (sh, bash, zsh, dash, fish, cmd, powershell, pwsh) and privilege tools (sudo, su, doas, chmod, chown, kill, pkill), and enforced policy.check_program() before test_connector spawns mcp-stdio. |
tools.rs, memory.rs, runtime.rs |
| SEC-06 | Predictable new key derivation & partial writes | New <home>/sovereign.key creation mixes /dev/urandom OS entropy with PID/time/path via BLAKE3 (while preserving existing keys), state directories use 0700, and config.json, policy.json, connectors.json, palace.json, honcho.json, and chat session files commit atomically via write_private_atomic (0600 temp file + rename). |
memory.rs, runtime.rs, palace.rs, sessions.rs |
| SEC-07 | Control chars & arbitrary enum values in config payloads | Sanitized SettingsUpdate and FirebaseHybridConfig fields (strip_ctrl), clamping backend (google_ai / agent_platform, normalizing legacy vertex_ai) and inference_mode (prefer_on_device / only_on_device / prefer_in_cloud / only_in_cloud), plus deep-nesting JSON regression test (JsonError::NestingTooDeep). |
memory.rs, runtime.rs, json.rs |
To avoid overstating guarantees beyond what the code enforces:
- Protocol Magic vs. Security (
0x62): TheGATE_MAGIC(0x62) byte inAuditFrame64is a wire protocol framing discriminator, not an authentication or security boundary. - Authentication vs. Authorization vs. Truth: A verified keyed BLAKE3
witness_sealproves only local-key integrity of the 40-byte frame prefix; it does not authorize an action (that is separate capability-rung policy) and does not prove the semantic truth or correctness of an LLM answer or trace. - Loopback Threat Model & OS Isolation: Binding
127.0.0.1+ validatingHost/Origin/X-Aristotele-Tokenmitigates browser-based attacks (DNS rebinding, cross-site CSRF). Same-user local processes on the same machine share OS user privileges and can read~/.aristotele(0600) or probe127.0.0.1. Memory safety in Rust (0 unsafe) does not replace OS sandboxing, containers, or hardware privilege separation. - Capability Token Lifecycle:
CapabilityTokenchecks local MAC, rung (0..=3), scope hash, and optional unix-epoch expiration. Cross-invocation nonce replay prevention is not maintained globally without an external nonce ledger. - Atomicity & Replay Scope: Configuration/memory files use per-file
0600temp+rename atomic replacement, andSPHIST/1WAL appends entries sequentially with hash chaining; this is not a distributed multi-resource ACID transaction protocol.replay_verify()validates log sequence order, local MACs, and payload hashes — it does not re-execute or prove determinism of external filesystem, subprocess, or network side effects. - Execution Gating vs. Model Alignment: Capability rungs restrict local tool/network invocation in Rust regardless of upstream LLM prompt behavior; they solve orthogonal problems from model-level safety training and are not a substitute for upstream model alignment or OS sandboxing.
#![no_std]Core Crates vs. OS-Hosted Binaries: Three core library crates (aristotele-spherepop,aristotele-beehive,aristotele-hiverl) compile with--no-default-featuresonaarch64-unknown-none. ThearistoteleCLI/Studio binary (aristotele-cli,aristotele-ayefire) is a standard OS-hosted application linking OS libc/threads/sockets/Metal/curl and is not a bare-metal OS kernel.
- External
crates.ioruntime dependencies:0across all 6 workspace crates (8b-is/kolibrycore crates are pinned via git revision inCargo.lock). unsafeRust code in workspacecrates/:0blocks/functions/traits/impls (enforced viacargo clippy --workspace --all-targets -- -D warnings -F unsafe_code).#![no_std]core crates:aristotele-spherepop,aristotele-beehive, andaristotele-hiverlbuild cleanly with--no-default-featuresonaarch64-unknown-none.
Please open a Private Security Advisory in GitHub Security for 8b-is/aristotele (do not file public issues with exploit payloads against active deployments). Include reproduction steps, affected crate/version (aristotele --version), and suggested scope.