Skip to content
THE OTA MANUALCore architecture
Updatedv0.1.0 ↗

Security model ​

Every OTA download must pass three independent checks before the staged directory can ever become eligible to boot.

Jolt Fault Lab

Three-Part Verification Gate Lab

ota-ns serve --mode update
1. Authenticity (Ed25519)PASS
CryptoKit / Google Tink

keyId="prod-2026" verified on canonical JCS payload

2. Compatibility & SeqPASS
runtimeContract + targetBuild

ios-rc-16579a18 · build 1 · directiveSeq 8 > 7

3. Integrity (SHA-256)PASS
Streaming 11/11 files

Exact byte lengths, zero symlinks, zero extra files

STAGE_COMMITTED (ota-vue-v2)

All three gates passed: staging/ moved atomically into releases/ota-vue-v2.

Three separate security questions ​

PropertyQuestion answeredEnforcement
AuthenticityWas this directive and manifest authorized by the publisher?Ed25519 signature over canonical JCS payloads verified via Apple CryptoKit (iOS) or Google Tink Ed25519Verify (Android) against public keys embedded in the binary (publicKeys[keyId]).
IntegrityDid every file arrive intact with no extras or path traversal?Every file in manifest.files is downloaded to isolated staging/<releaseId>, checked for exact byte length and streaming SHA-256 digest, with symlinks, .. traversal, missing files and unexpected extra files rejected.
Compatibility & freshnessCan this release run on this binary without replaying an older directive?protocolVersion, appId, platform, targetBuild and runtimeContract must match the installed binary; directiveSeq must be monotonic against lastDirectiveSeq.

Key management & rotation ​

  • Private signing keys never enter the app binary or app source repository. ota-ns keygen refuses by default to output private keys inside src/, app/, App_Resources/ or platforms/.
  • Key rotation works without a hard cutoff: embed both the current and next public keys in ota.config.json under distinct keyId strings ("prod-2026", "prod-2027"). Start signing releases with "prod-2027" once devices running the updated binary have rolled out, then remove "prod-2026" in a later store release.

Client threat model boundaries ​

Treat anything embedded in the binary as public

Any update endpoint URL, channel name or read-only API token embedded inside an iOS .ipa or Android .apk can be extracted by inspecting the binary.

  • Never rely on an embedded bearer token as a substitute for Ed25519 signature verification.
  • Never ship secrets, private credentials or sensitive business data inside OTA JS bundles.
  • Always serve production update checks and bundle files over HTTPS (TLS). The SDK enforces HTTPS by default and rejects plain HTTP with OtaError(INSECURE_URL) unless allowInsecureHttp: true is explicitly configured for local testing.

Storage hardening ​

  • iOS: OTA state and releases live under Library/Application Support/com.getcortexlabs.ota with NSURLIsExcludedFromBackupKey set so iCloud/iTunes device backups do not restore stale bundles across devices or newer store binaries.
  • Android: OTA state and releases live inside app-private context.getFilesDir()/ota (never external/shared storage). Keep android:allowBackup="false" in AndroidManifest.xml so Android Auto Backup cannot restore mismatched state.json or release directories.
  • Bundle size cap: StagingManager enforces a configurable maxBundleBytes cap (default 50 MiB) to prevent disk exhaustion from malformed manifests.