Security Overview
JetPack exposes local native hardware and OS-level compute to web applications running inside untrusted browser origins. Because a local daemon listening on 127.0.0.1 is an attractive target for malicious websites, DNS rebinding, browser extensions, and supply-chain tampering, JetPack enforces defense-in-depth across four distinct security boundaries.
Threat Model & Trust Boundaries
| Boundary | Threat Addressed | Enforcement Mechanism |
|---|---|---|
| 1. Browser <-> Daemon Transport | Cross-site WebSocket hijacking, DNS rebinding, rogue local tabs, plaintext inspection | Strict 127.0.0.1 bind, HTTP Upgrade Origin allowlist + W3C PNA, Out-of-Band jetpack://pair + native OS dialog, X25519 + Ed25519 handshake, ChaCha20-Poly1305 encrypted framing, 1003 close on JSON/text frames |
| 2. At-Rest Credential & Consent Store | Local unprivileged malware or SQLite tools reading paired keys or authorized folder paths | 256-bit ChaCha20-Poly1305 (AEAD) encrypted SQLite container (paired_clients.db) with master key stored exclusively in OS Vault (DPAPI / Keychain / Secret Service), Unix 0700 / 0600 directory and file permissions |
| 3. Daemon <-> Native Worker Sandbox | Malicious or compromised AI/media worker reading user documents (~/Documents, ~/.ssh), spawning hidden background processes, or exfiltrating data over the internet | Default-deny OS kernel sandboxes (Windows AppContainer + Job Objects, macOS Seatbelt, Linux bwrap + Landlock LSM), user-selected [volumes] via native OS rfd picker, and an in-daemon Userspace Network Proxy filtered by permissions.network_allowlist |
| 4. App Store & Supply Chain | Tampered catalog entries, App ID spoofing (io.jetpack.*), registry redirection, Tar-Slip extraction, linker injection (LD_PRELOAD) | Compiled-in CATALOG_VERIFY_PUBKEY (Ed25519), manifest_sha256 pinning, per-app allowed_origins enforcement, SHA-256 CAS verification, Tar-Slip rejection, and #[serde(deny_unknown_fields)] manifest validation |
Architectural Security Guarantees
Rust as the Sole Gatekeeper
Browser code (@jetpack-desktop/client / jetpack-wasm) never opens sockets or named pipes directly to Python or C++ workers. All external traffic terminates inside jetpack-daemon (crates/jetpack-daemon/src/ws_server.rs), which:
- Refuses to bind to
0.0.0.0,::, or any non-loopback IP address before opening a TCP listener. - Validates the normalized HTTP
Originheader on bothOPTIONSPrivate Network Access preflights and WebSocketGETupgrades againstpaired_clients.db(or the daemon's own Control Center originhttp://127.0.0.1:<port>). Rejects unknown or missing origins withHTTP/1.1 403 Forbidden. - Enforces a 5-second post-upgrade cryptographic
ClientHellohandshake binding the HTTPOrigintoClientHello.originand the pairedEd25519public key. - Enforces per-application
Originauthorization before"app.launch"or forwarding any frame withtarget_workerset.
Zero Client Trust for Host Paths & Privileges
- Web clients cannot pass absolute host filesystem paths to workers; any path in
AppLaunchRequestis ignored/rejected. Host folders for[volumes.<name>]are selected exclusively by the human user through the native OS folder dialog (rfd). - Web clients cannot bypass
SignedAppCatalogverification via"settings.set"(developer_mode = truenever enables unverified network"app.pull"). - Local developer apps (
--install-local-app) are restricted strictly to non-official IDs (never shadowingSignedAppCatalogentries) and can only be invoked from loopback origins (127.0.0.1/localhost). - Self-update execution (
"update.apply") is restricted exclusively to the embedded loopback Control Center origin (is_own_loopback_origin). Every release download enforceshttps://(or loopbackhttp://for tests), strictSHA-256verification againstSHA256SUMS.txtwith immediate deletion on mismatch, and Zip-Slip / Tar-Slip symlink-escape rejection before replacing binaries or bundled starter apps in user space.
Detailed Security Audit Sections
- Pairing & Cryptography: Out-of-Band
jetpack://pair,X25519+Ed25519handshake,ChaCha20-Poly1305framing, andChaCha20-Poly1305at-rest store + OS Vault key management. - OS Kernel Sandboxing: Platform-by-platform kernel primitives (
AppContainer,Seatbelt,bwrap+Landlock LSM) and Userspace Network Proxy filtering. - Signed Catalog & Anti-Spoofing:
Ed25519root key verification,manifest_sha256pinning, and per-appOriginisolation.
