Sensitive data is encrypted at rest using platform-secure storage
Why it matters
AsyncStorage in React Native is unencrypted plaintext on every platform — its contents are readable from a jailbroken iOS device or from any app on Android versions below 4.4. Storing auth tokens, JWTs, or user PII in AsyncStorage means a single compromised device exposes session credentials that can be replayed to impersonate the user with full account access. OWASP 2021 A02 (Cryptographic Failures), CWE-312 (Cleartext Storage of Sensitive Information), HIPAA §164.312(a)(2)(iv), and NIST SP 800-218 PW.4 all require sensitive data at rest to be encrypted using platform-provided mechanisms (Keychain on iOS, Keystore on Android).
Severity rationale
High because auth tokens in AsyncStorage are accessible to any process on a compromised device, enabling session hijacking and full account takeover without a network attack.
Remediation
Replace AsyncStorage for sensitive data with expo-secure-store, which uses Keychain on iOS and EncryptedSharedPreferences on Android:
import * as SecureStore from 'expo-secure-store';
// Store
await SecureStore.setItemAsync('authToken', token);
// Retrieve
const token = await SecureStore.getItemAsync('authToken');
For non-Expo React Native, use react-native-keychain:
import * as Keychain from 'react-native-keychain';
await Keychain.setGenericPassword('token', jwtValue);
Search for every AsyncStorage.setItem call in src/ and audit what is being stored. Move tokens and PII to secure storage; leave only non-sensitive preferences (theme, language) in AsyncStorage.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the App Store Privacy & Data Compliance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-312 — Cleartext Storage of Sensitive Information
- owasp:2021 · A02 — Cryptographic Failures
- nist:rev5 · SC-28 — Protection of Information at Rest
- hipaa · §164.312(a)(2)(iv) — Encryption and decryption of ePHI
- ssdf:800-218 · PW.4 — Reuse Existing, Well-Secured Software When Feasible
Taxons
History
- 2026-04-18·v1.0.0·Initial import from app-store-privacy-data·automated