SPB Git

Repository Public

THREAT_MODEL.md 5.3 KB

# Threat model

SP Vault holds photographs and details of one person's identity documents and bank cards on one iPhone. It has no server, no account and no network code. This document says what it defends against, how, and what it does not defend against.

# Assets

Asset Sensitivity
Photographs of cards (front and back) High — enough to impersonate or to pay online if the security code were present
Card and document numbers, holder name, expiry, notes, custom fields High
Master key, per-card keys Critical — they open everything above
Recovery passphrase, backup passphrase Critical — never stored
Search index High — derived from the records
Interface preferences (layout, appearance, reminder defaults) Low — kept in UserDefaults, describe no card

# Trust boundaries

The app trusts iOS, the Secure Enclave, the Keychain and Apple's cryptographic frameworks. It trusts nothing that arrives from outside its sandbox: a .spvault file is parsed defensively and fully authenticated before a single card is written.

# Threats and mitigations

# Threat Mitigation Residual risk
T1 Someone picks up the unlocked iPhone and opens the app Face ID at every launch and every return from the background; the key is read from the Keychain behind biometryCurrentSet; no passcode fallback A person who can pass Face ID as the owner
T2 Someone who knows the iPhone passcode adds their own face biometryCurrentSet: the Keychain item is invalidated by any change of the enrolled set; the vault then asks for the recovery passphrase If that person also knows the recovery passphrase
T3 The file system is extracted (forensic tool, jailbreak, stolen backup) Vault directory excluded from backups; every file AES-256-GCM under keys that exist only behind the Keychain; NSFileProtectionComplete recovery.key can be attacked offline: strength of the passphrase × 600 000 PBKDF2 iterations
T4 A file is altered, replaced by an older or foreign one, or moved between cards AES-GCM authentication with `vault card
T5 The app is switched away from while a card is on screen Lock when the scene enters the background; opaque curtain window above everything as soon as the app is inactive, so the switcher snapshot shows no card —
T6 Navigation trick to reach content while locked The unlocked shell is not in the view hierarchy while locked; decrypted data and key are dropped at lock, so there is nothing to show —
T7 Shoulder surfing Numbers masked by default, last four only in lists; full number needs a fresh Face ID check and hides itself after 30 s; Privacy Mode veils card faces Whoever watches during a reveal
T8 Screenshots and screen recording Recording/mirroring detected (isSceneCaptured) → curtain; screenshots are detected after the fact and reported (banner + generic notification) iOS does not let an app prevent a screenshot. A screenshot taken while a card is visible lands in Photos
T9 Clipboard leakage Nothing is ever copied automatically; an explicit copy is local-only (no Universal Clipboard) and expires after 60 s Another app pasting within those 60 s (iOS shows the paste banner)
T10 Notifications on the lock screen Reminder text is generic and names no card; no widget, no Spotlight indexing, no Siri donation —
T11 The security code of a bank card ends up stored No such field exists; forbidden labels and track-data patterns are refused; the code is blacked out in the photograph before encryption, with a manual validation step A code the owner types into free-text notes on purpose; a code printed on the front that the owner does not mask
T12 Data sent off the device No networking code, no third-party SDK, no analytics, no crash reporter; logs contain no card data iOS's own diagnostics are outside the app's control (they contain no vault content)
T13 Malicious or corrupted .spvault file Length checks, version check, minimum KDF cost, per-record authentication with index and final flag, card-count check, sanitising on restore A very large file costs memory (single-owner use; not hardened against resource exhaustion)
T14 Loss of the iPhone or of Face ID access Encrypted .spvault export; optional recovery passphrase No backup and no recovery passphrase means the data is lost — by design
T15 Interrupted write, full disk Atomic file writes; staged card creation; failed saves leave the vault unchanged —
T16 Camera captures leaking Captures stay in memory as bitmaps; nothing is written to Photos or to a temporary file —

# Out of scope

  • A compromised operating system (jailbreak with a live kernel implant) while the vault is unlocked: the key is then in the memory of a process the attacker controls.
  • Coercion of the owner.
  • Hardware attacks on the Secure Enclave.
  • Protection of exported .spvault files against a weak passphrase chosen despite the policy.

# Privacy statement

SP Vault collects nothing, transmits nothing and contains no tracking. The privacy manifest (PrivacyInfo.xcprivacy) declares no collected data type and no tracking domain.

Files main
Menu

Theme