React Native · Mobile UI at native speed
What security concerns matter in a React Native app?
Short answer
Protect tokens with secure storage, enforce TLS, keep secrets out of the bundle, validate deep links and WebView content, and treat the device as untrusted. Client checks are deterrents, not guarantees.
A mobile app ships its code to users, so anything embedded in the bundle can be extracted. Security therefore depends on keeping secrets server-side, minimising what the client knows, and protecting the transport and local storage of sensitive data.
The essentials
- Store tokens and keys in Keychain or Keystore-backed storage, not AsyncStorage
- Use TLS everywhere and consider certificate pinning for high-risk APIs
- Never embed API secrets, private keys or admin credentials in the bundle
- Validate every deep link and WebView URL against an allowlist
- Clear sensitive data on logout and avoid logging tokens or personal data
- Disable text selection or screenshots for highly sensitive screens where appropriate
import * as SecureStore from "expo-secure-store";
export async function saveSession(token: string) {
await SecureStore.setItemAsync("session", token, {
keychainAccessible: SecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
});
}
export async function clearSession() {
await SecureStore.deleteItemAsync("session");
}Certificate pinning raises the bar but adds operational risk: rotating a certificate without updating the app can break every user. Use it only with a rotation plan and backup pins. Jailbreak and root detection can be bypassed, so use them as signals rather than as the only control.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Where should an auth token be stored?
- 2What are the risks of certificate pinning?
- 3Why is client-side authorisation insufficient?
- 4How do you secure a WebView?
Say it in the interview
I assume the client is untrusted. Tokens go in Keychain or Keystore-backed storage, transport is TLS, and no secrets are embedded in the bundle. I validate deep links and WebView URLs against an allowlist and enforce authorisation on the server, because hiding UI is not access control. Certificate pinning is useful for high-risk APIs, but only with a certificate rotation plan.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live React Native mock interview and get scored feedback on depth, clarity and confidence.