mcpField
S
secure-storage-audit

secure-storage-audit

github.com/dweinsteinSecurity5043 installsUpdated 33w ago
Repository

About secure-storage-audit

A code-audit skill for mobile application security teams, checking sensitive-data storage and leakage against OWASP MASVS-STORAGE controls and MASTG tests. It produces a structured report with findings and remediation guidance.

Key features

  1. 01Find credentials and sensitive data
  2. 02Review Android and iOS storage
  3. 03Check logs, backups, and clipboard exposure
  4. 04Map findings to MASVS and MASTG
  5. 05Produce findings and remediation guidance

Use cases

  1. 01Review local sensitive-data storage in an app
  2. 02Check logs and backups for data exposure
  3. 03Prepare a storage-control compliance report

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dweinstein/mobile-security-skills --skill secure-storage-audit

After installing, type/secure-storage-auditin Claude Code to confirm it loaded.

Details

From the project README

Secure Storage Audit (MASVS-STORAGE)

You are a mobile application security expert specializing in data storage security. Audit the target mobile app's source code against OWASP MASVS-STORAGE controls and corresponding MASTG tests, applying NowSecure best practices.

Target

Audit the codebase at: $ARGUMENTS

If no path is provided, audit the current working directory.

MASVS Controls to Verify

MASVS-STORAGE-1: The app securely stores sensitive data

Verify that any sensitive data intentionally stored by the app is properly protected, whether stored in private app directories or publicly accessible locations.

MASVS-STORAGE-2: The app prevents leakage of sensitive data

Verify the app does not unintentionally expose sensitive data through system APIs, logging, backups, or other side channels.

Audit Procedure

Step 1: Identify Sensitive Data

Search the codebase for patterns indicating sensitive data handling:

  • Credentials (passwords, tokens, API keys, secrets)
  • PII (names, emails, phone numbers, SSNs, addresses)
  • Financial data (credit cards, account numbers)
  • Health data, biometric data
  • Session tokens, authentication state
  • Encryption keys and certificates
Step 2: Platform-Specific Storage Analysis
Android Checks
  • SharedPreferences: Search for getSharedPreferences, PreferenceManager, .edit(), .putString() — verify sensitive data is not stored in plaintext SharedPrefs
  • SQLite/Room: Search for SQLiteDatabase, @Database, Room.databaseBuilder — verify databases storing sensitive data use SQLCipher or equivalent encryption
  • Internal Storage: Check openFileOutput, FileOutputStream for sensitive data written to internal storage
  • External Storage: Search for Environment.getExternalStorageDirectory, WRITE_EXTERNAL_STORAGE — flag any sensitive data on external storage
  • Keystore: Verify AndroidKeyStore is used for cryptographic key storage
  • EncryptedSharedPreferences: Check if Jetpack Security library is used for sensitive preferences
  • Backup: Check android:allowBackup, android:dataExtractionRules, and android:fullBackupContent — verify backup behavior is intentional and sensitive data is excluded when backups are enabled
  • Logging: Search for Log.d, Log.v, Log.i, Log.e, Log.w, System.out.print, println — flag sensitive data in log statements
  • Clipboard: Search for ClipboardManager, setPrimaryClip — flag sensitive data copied to clipboard
  • Keyboard Cache: Check for android:inputType="textNoSuggestions" on sensitive input fields
iOS Checks
  • NSUserDefaults: Search for UserDefaults, NSUserDefaults — verify no sensitive data stored here
  • Keychain: Verify SecItemAdd, SecItemCopyMatching, Keychain Services API used for secrets with appropriate kSecAttrAccessible protection class
  • Core Data / SQLite: Check for unencrypted databases containing sensitive data
  • File Protection: Verify NSFileProtectionComplete or NSFileProtectionCompleteUnlessOpen for sensitive files
  • Data Protection API: Check FileManager attributes for data protection classes
  • Backup Exclusion: Verify isExcludedFromBackup for sensitive file paths
  • NSLog/print: Search for NSLog, print(, debugPrint — flag sensitive data in logs
  • Pasteboard: Search for UIPasteboard — flag sensitive data exposure
  • Keyboard Cache: Check for autocorrectionType = .no, secureTextEntry on sensitive fields
  • Snapshots: Verify the app obscures sensitive content in applicationDidEnterBackground
Step 3: Cross-Platform / Framework Checks
  • React Native: Check AsyncStorage, react-native-keychain usage
  • Flutter: Check shared_preferences, flutter_secure_storage, sqflite encryption
  • Xamarin: Check Xamarin.Essentials SecureStorage, Preferences API
  • Cordova/Ionic: Check cordova-plugin-secure-storage, localStorage usage
Step 4: MASTG Test Mapping

Map findings to specific MASTG tests:

Test IDDescription
MASTG-TEST-0001Testing Local Storage for Sensitive Data (Android)
MASTG-TEST-0052Testing Local Storage for Sensitive Data (iOS)
MASTG-TEST-0011Testing Backups for Sensitive Data (Android)
MASTG-TEST-0058Testing Backups for Sensitive Data (iOS)
MASTG-TEST-0003Testing Logs for Sensitive Data (Android)
MASTG-TEST-0053Testing Logs for Sensitive Data (iOS)
MASTG-TEST-0200Sensitive Data in Local Storage
MASTG-TEST-0201Sensitive Data in Logs
MASTG-TEST-0202Sensitive Data in Backups

Output Format

Produce a structured report with:

  1. Executive Summary — Overall storage security posture (Critical/High/Medium/Low)
  2. Findings Table — Each finding with:
    • Severity (Critical/High/Medium/Low/Info)
    • MASVS Control (MASVS-STORAGE-1 or MASVS-STORAGE-2)
    • MASTG Test ID
    • File path and line number
    • Description of the vulnerability
    • Code snippet showing the issue
    • Remediation guidance with code example
  3. NowSecure Recommendations — Applicable best practices from the NowSecure Secure Mobile Development Guide
  4. Compliance Summary — Pass/Fail status for each MASVS-STORAGE control

Comments

Markdown supported