Skip to content

[Security] AsyncStorage used as fallback for sensitive data when MMKV fails — plaintext storage of tokens #856

Description

@RUKAYAT-CODER

Overview

If MMKV storage initialization fails, some code paths fall back to AsyncStorage for persisting auth-adjacent data. AsyncStorage is unencrypted plaintext storage — using it for session-related data exposes tokens on rooted/jailbroken devices.

Specifications

Features:

  • Remove AsyncStorage as a fallback for any auth or session-related data
  • If MMKV fails, show a storage error screen rather than downgrading to plaintext storage

Tasks:

  • Audit all AsyncStorage usages and categorize them (sensitive vs non-sensitive)
  • Replace sensitive AsyncStorage usages with secureStorage or remove the fallback
  • Add a lint rule to warn on AsyncStorage usage in auth-related files

Impacted Files:

  • src/store/createStore.ts
  • src/services/secureStorage.ts
  • All files importing AsyncStorage for auth-related data

Acceptance Criteria

  • No AsyncStorage used for tokens or session data
  • MMKV failure shows a recovery screen, not a plaintext fallback
  • Lint rule prevents future AsyncStorage use in auth modules

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programbugSomething isn't workingsecuritySecurity vulnerability or concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions