Signed Catalog & Anti-Spoofing
JetPack enforces a hard security boundary between Verified App Store Catalog applications and Local Unverified Developer applications (crates/jetpack-daemon/src/catalog.rs).
1. Embedded Platform Root Key (CATALOG_VERIFY_PUBKEY)
jetpack-daemon compiles in the platform's 32-byte Ed25519 verifying public key (CATALOG_VERIFY_PUBKEY) alongside the embedded base SignedAppCatalog (crates/jetpack-daemon/assets/catalog.signed.json).
- Outside
#[cfg(test)],CATALOG_VERIFY_PUBKEYis strictly immutable and cannot be overridden bydaemon.toml, environment variables, or WebSocket control-plane opcodes. - Before trusting any catalog entry (remote, cached, or embedded),
SignedAppCatalog::from_signed_json_and_verifycomputes the canonical payload bytes (SignedAppCatalog::canonical_payload_bytes(), coveringversion, orderedappsentries, andcoming_soon, plus optional size/model metadata) and verifiesed25519_signatureusinged25519-dalek. - Any tampering with
oci_reference,manifest_sha256,allowed_origins,launch_url,poster_url,coming_soon,version,min_vram_mb,install_size_bytes,platform_install_sizes,install_size_approximate, ormodels(CatalogModelEntry)—or a signature produced by an untrusted keypair—fails immediately withJetPackError::CatalogSignatureInvalid. Optionalposter_urlvalues must use'self'-relative paths (/posters/...without..or//) orhttps://URLs without userinfo, andmodels[*].source(when present) must be anhttps://URL (or loopbackhttp://). - When an authenticated client sends
"catalog.estimate_sizes"(OPCODE_CATALOG_ESTIMATE_SIZES),jetpack-daemonresolves the hostTargetPlatform(windows/amd64,darwin/arm64,linux/amd64), checks cached CAS blobs, shared runtimes,uv, and Python artifacts, falls back cleanly to signedplatform_install_sizes/install_size_bytesbaselines if offline, and reports remaining initial install download size separately from lazy runtime AI model footprints (models_total_bytes).
2. Remote Catalog Refresh, Verified Caching & Offline Fallback
DaemonConfig (<root>/config/daemon.toml) configures an optional top-level catalog_url defaulting to https://raw.githubusercontent.com/jetpack-desktop/jetpack/main/crates/jetpack-daemon/assets/catalog.signed.json (setting catalog_url = "" disables remote fetches cleanly for air-gapped setups). Non-empty URLs must use https:// (or loopback http://127.0.0.1 / localhost / ::1 for local testing).
When an authenticated client requests "catalog.get":
- Bounded HTTPS Fetch: The daemon asynchronously fetches
catalog.signed.jsonwith a strict 3-second timeout and a 2 MiB response size cap viareqwest(rustls-tls). - Signature & Anti-Rollback Check: The remote payload must verify against
CATALOG_VERIFY_PUBKEYand haveremote.version >= embedded.version. - Atomic Cache Persistence: Validated catalogs are atomically written to
<root>/config/catalog.cached.json(0600permissions on Unix). - Transparent Fallback: If the network is unreachable, times out, returns an error, or presents a tampered/rolled-back payload, the existing cache is never overwritten and the daemon transparently falls back to the last verified
<root>/config/catalog.cached.json(if valid andcached.version >= embedded.version) or the compiled-inEMBEDDED_SIGNED_CATALOG_JSON.
3. Verified Network Pulls, coming_soon & Digest Pinning
When an authenticated client invokes "app.pull":
- Catalog-Only Network Pulls: The daemon resolves
app_idoroci_referenceexclusively against the active verifiedSignedAppCatalog. Any request targeting an unlisted image returns"app.error"with codeUNVERIFIED_APP_BLOCKEDwithout contacting any remote registry. coming_soonAvailability Enforcement: Announced future catalog entries markedcoming_soon: true(rendered in the Control Center Store with a non-interactive Coming Soon badge) are rejected on"app.pull"withPROVISIONING_FAILEDbefore contacting any OCI registry.- No Browser Privilege Escalation: Even if
"settings.set"togglesdeveloper_mode = true, browser WebSocket sessions are never permitted to pull unverified OCI references from the network. - Immutable Digest & Reference Pinning: Client-supplied registry URLs, tags, or digest overrides are ignored. The daemon pulls strictly from
CatalogAppEntry.oci_referenceand verifies that the resolved OCI manifest digest matchesCatalogAppEntry.manifest_sha256. - Inner Manifest App ID Verification: After unpacking the OCI layer (with Tar-Slip path traversal checks), the daemon verifies that
app.toml's[package].idmatchesCatalogAppEntry.app_id. Mismatches are rejected withAPP_SPOOFING_DETECTEDorPROVISIONING_FAILEDbefore materializing into<root>/apps/.
4. Anti-Spoofing for Local Developer Apps vs. Curated Offline Seeding
Developers can install custom local workers on their own machine using the CLI (jetpack-daemon --install-local-app <dir>):
- Official ID Protection: If a local app's
app.tomlattempts to use anapp_idreserved inSignedAppCatalog(such asio.jetpack.media-converter),--install-local-apprejects it withAPP_SPOOFING_DETECTED. - Verified Provenance Tracking: Apps installed via verified catalog
"app.pull"—or seeded strictly from the daemon's curatedexamples/allowlist (--seed-core-apps/ first-run hook guarded by<root>/config/.core-apps-seeded)—carry verified provenance (is_verified = trueinAppInfo). Custom local apps always reportis_verified = falseand display a yellowUNVERIFIED / LOCAL DEVbadge in the Control Center and system tray.
5. Per-Application WebSocket Origin Authorization
Having a paired WebSocket session does not grant a web origin access to every installed worker on the user's machine. Before "app.launch" or forwarding any HybridFrame with target_worker set, jetpack-daemon checks:
| App Provenance | Authorized WebSocket Origins | Unauthorized Result |
|---|---|---|
Verified Catalog App (is_verified = true) | Normalized origins listed in CatalogAppEntry.allowed_origins OR the embedded Control Center origin (http://127.0.0.1:<port>) | Rejected with "app.error" code ORIGIN_NOT_AUTHORIZED_FOR_APP |
Local Developer App (is_verified = false) | Loopback HTTP origins only (http://127.0.0.1[:port], http://localhost[:port]) | Rejected with "app.error" code ORIGIN_NOT_AUTHORIZED_FOR_APP |
Remote paired origins (e.g. https://app.example.com) can never launch or send IPC frames to unverified local-dev workers, nor can one catalog app's origin invoke another catalog app's worker unless explicitly authorized in allowed_origins.
