Skip to main content

Secure by Default

Launch is configured with security best practices out of the box. Here’s what’s protected and how.

Prerequisites

  • Expo SecureStore installed
  • Auth client configured

Steps

Authentication & Token Storage

Auth tokens are stored securely using expo-secure-store
This means:
  • iOS: Tokens are stored in the Keychain (hardware-backed encryption)
  • Android: Tokens are stored in the Keystore (hardware-backed encryption)
Even on jailbroken/rooted devices, this data is significantly harder to extract than plaintext storage.

Choosing the Right Storage

Both AsyncStorage and SecureStore have their place. The key is knowing what data belongs where.

AsyncStorage

Unencrypted key-value storage. Fast and simple, but readable on compromised devices.

SecureStore

Encrypted via native Keychain/Keystore. Hardware-backed protection for sensitive data.

When to Use AsyncStorage βœ…

AsyncStorage is perfectly fine for non-sensitive, non-PII data:

When to Use SecureStore πŸ”’

Use SecureStore for anything that could harm the user if exposed:

What Launch Stores Where

Quick Decision Guide

Ask yourself: β€œIf someone read this data, could they harm the user?”
  • No β†’ AsyncStorage is fine
  • Yes β†’ Use SecureStore
Never store in AsyncStorage: - Authentication tokens or session IDs - Passwords, PINs, or security codes - API keys or secrets - Credit card numbers or financial data - Personal identification (SSN, passport, driver’s license)
  • Health or medical information

Troubleshooting

  • Tokens not stored: check SecureStore permissions
  • Unexpected logout: verify session persistence and SecureStore availability

Next Steps


Best Practices

Be Mindful About What You Store

Before storing any data locally, consider its sensitivity:

Think Before You Store

When adding features that persist data, ask:
  1. Could this data harm the user if exposed? β†’ SecureStore
  2. Could this data impersonate the user? β†’ SecureStore
  3. Is this financial or personal information? β†’ SecureStore
  4. Is this just a preference or app state? β†’ AsyncStorage is fine

Audit Storage Periodically

Search your codebase to review what’s being stored:
Ensure sensitive data isn’t accidentally stored in AsyncStorage.

What Happens on Jailbroken/Rooted Devices

AsyncStorage Exposure

On a jailbroken iOS device or rooted Android device:

SecureStore Protection

SecureStore data is stored in:
  • iOS: Keychain (encrypted, access-controlled)
  • Android: Keystore (hardware-backed encryption)
Even with root access, extracting Keychain data requires:
  • Specialized forensic tools
  • Device-specific exploits
  • Significantly more effort and expertise
SecureStore isn’t impenetrable on jailbroken devices, but it raises the bar dramatically compared to AsyncStorage.

Additional Mobile Security Measures

Remove Sensitive Console Logs

Before production builds, remove any console.log statements that output sensitive data:

Consider Certificate Pinning (High-Security Apps)

For apps handling financial data or highly sensitive information:

Consider Jailbreak Detection (Financial Apps)

For banking or payment apps, consider detecting compromised devices:
Jailbreak detection can be bypassed by determined attackers. Use it as one layer in defense-in-depth, not as your only protection.

Quick Security Audit

Run this checklist for your app:
1

Search for AsyncStorage

Find all uses: grep -r "AsyncStorage" apps/mobile/
2

Verify no sensitive data

Check each usage stores only non-sensitive data
3

Confirm SecureStore for auth

Verify lib/auth/client.ts uses storage: SecureStore
4

Remove sensitive logs

Search for console.log with tokens, passwords, or user data
5

Check third-party SDKs

Verify payment SDKs (Stripe, RevenueCat) use secure storage

Summary

Launch is secure by default. Authentication tokens and sensitive session data are stored using expo-secure-store, which provides hardware-backed encryption on both iOS and Android.