DEV Community

Russel Dsouza
Russel Dsouza

Posted on • Originally published at rapidnative.com

5 Places Sensitive Data Leaks in a React Native App (and How to Plug Them)

  • The leaks that matter usually aren't in production code — they're in the workflow around it.
  • Five common ones: AsyncStorage for tokens, real user data in design mockups, multi-stage AI pipelines, logs and crash reports, and bundled permissions.
  • Two greps that find real bugs today: AsyncStorage.setItem near token, and console.log(user / console.log(token / console.log(prompt.
  • Model consent by purpose, not by OS permission. Camera consent is not AI-summarization consent.

Data protection posts usually focus on the shipped binary. Encrypt this, pin that certificate, wrap the API client. All correct, all necessary — and all too late if the leak happened three weeks earlier in a design mockup.

We build AI-generated React Native apps at RapidNative, and the interesting security bugs almost never live in production code. They live in the space between code, design, and AI workflows. Here are five leak points we've watched teams miss.

1. AsyncStorage for anything sensitive

The classic. AsyncStorage is convenient, unencrypted key-value storage. A user session token in AsyncStorage is one rooted device or one iCloud backup extraction away from being replayed.

Fix: use expo-secure-store (Keychain on iOS, Keystore on Android) for anything that unlocks an account.

import * as SecureStore from 'expo-secure-store';

export async function saveSessionToken(token) {
  await SecureStore.setItemAsync('session_token', token);
}
Enter fullscreen mode Exit fullscreen mode

If your codebase greps positive for AsyncStorage.setItem and token, that's your first PR.

2. Real user data in design prototypes

A designer opens Figma, needs a realistic list, and pastes 20 rows from the production customer export. Now customer names sit in the design file, which sits in a Figma team folder, which was shared to a contractor's personal email nine months ago.

Fix: a synthetic data script committed to the repo. npx generate-mocks users 20 should be faster than exporting production data. Make the fast path the safe path.

3. Multi-stage AI workflows

Voice memo lands. Transcription service returns text. A second model extracts tasks. Teammates get pinged.

That's four handoffs, and the security review probably only covers the API endpoint at step 1.

Fix: draw the pipeline as boxes, list what data each box sees, and confirm each hop has access controls tied to the user's actual consent — not a bundle. Camera consent is not AI-summarization consent.

4. Logs and crash reports

Sentry, Bugsnag, Datadog, or whatever log aggregator you use sees everything the app hands it. Session tokens in Authorization headers. AI prompt bodies with user text. Full user IDs in breadcrumbs.

Fix: scrub before you send. Most SDKs support a beforeSend hook.

Sentry.init({
  beforeSend(event) {
    if (event.request?.headers) delete event.request.headers.Authorization;
    return event;
  },
});
Enter fullscreen mode Exit fullscreen mode

Grep your codebase for console.log(user, console.log(token, and console.log(prompt. That's your second PR.

5. Bundled permissions

You ask for camera on onboarding: "we need this for document capture." The user agrees. Six months later a new AI-summarization feature ships that also uses camera frames.

Same permission, different purpose. Legally shaky (GDPR Article 25 asks for data minimization by design), and practically a betrayal of what the user thought they said yes to.

Fix: model consent as a first-class type, keyed on purpose rather than on OS permission:

type ConsentEvent = {
  userId: string;
  action: 'granted' | 'withdrawn';
  policyVersion: string;
  purpose: 'document-capture' | 'ai-summary' | 'marketing';
  surface: 'onboarding' | 'settings' | 'feature-gate';
  timestamp: string;
};
Enter fullscreen mode Exit fullscreen mode

Ship a new feature, ask again for that purpose. A one-line inconvenience for the user beats the €7.1B in GDPR fines the EU has issued as of January 2026.

The pattern

Notice what the five have in common: none of them are broken TLS, weak crypto, or a mangled JWT signature. They're all workflow leaks.

Encryption and pinning are table stakes. The bugs that leak your customer's data in 2026 are the ones nobody put in the security review — because they happen in Figma, in a Slack DM, in a Sentry payload, or in an AI pipeline diagram that was never drawn.

Draw the diagram. Grep the logs. Model consent. Ship.

Full source with the OWASP and NIST references: rapidnative.com/blogs/data-protection.

Which of the five would your codebase fail right now? Mine failed #4 the first time I checked.

Top comments (0)