Cross-platform mobile checks
React Native security testing guide for Android and iOS
React Native releases combine JavaScript or Hermes bytecode bundles with native Android and iOS code. Thorough mobile security testing inspects both layers together, verifies complete build artifacts, and pairs static signals with real-device evidence.
Where application logic lives in React Native builds
A production React Native package splits responsibilities across two runtimes. Most UI flows, API calls, and state management ship in the JavaScript bundle: assets/index.android.bundle inside an Android APK or AAB, and Payload/*.app/main.jsbundle inside an iOS IPA. In modern React Native releases, Metro compiles that bundle ahead-of-time into Hermes bytecode (.hbc) executed by libhermes.so on Android or hermes.framework on iOS; older or custom builds may still ship minified plain JavaScript.
Alongside the JS or Hermes bundle sits a full native wrapper: Java/Kotlin DEX bytecode, Android .so libraries, Swift/Objective-C Mach-O executables, and embedded iOS frameworks. Native code enforces platform storage, network security configuration, App Transport Security, deep-link routing, WebView bridges, and SDK permissions. Reviewing only source JavaScript misses native wrapper misconfigurations, while reviewing only native DEX or Mach-O skips secrets and insecure storage calls inside the JS bundle.
# Check whether Android and iOS bundles are Hermes bytecode or plain JS
unzip -p base.apk assets/index.android.bundle | file -
unzip -p App.ipa Payload/App.app/main.jsbundle | file -
# Hermes builds report Hermes bytecode header rather than ASCII JavaScript
Top React Native security pitfalls mapped to OWASP MASVS
When auditing a React Native release against OWASP MASVS, focus first on the recurring failure modes that cross the JS-to-native boundary:
- Storing tokens in unencrypted AsyncStorage (MASVS-STORAGE):
@react-native-async-storage/async-storagewrites key-value entries to unencrypted SQLite or file storage on Android and plain files on iOS. Persist JWTs, refresh tokens, and encryption keys only through hardware-backed wrappers such asreact-native-keychainorexpo-secure-storeconfigured with strict Keystore and Keychain accessibility. See our Android data storage guide and iOS Keychain guide. - Debug flags, dev menus, and Metro remnants (MASVS-CODE, MASVS-NETWORK): Verify that release builds disable
android:debuggable, strip developer menu shortcuts, and remove cleartext Metro bundler exceptions innetwork_security_config.xmlor iOSInfo.plist(NSExceptionDomainsor broadNSAllowsArbitraryLoadsoverrides). Review Android backup and debuggable flags for manifest checks. - Hardcoded API keys and
.envsecrets in bundles (MASVS-STORAGE, MASVS-CRYPTO): Build plugins likereact-native-configanddotenvinline environment values intoindex.android.bundle,main.jsbundle,BuildConfig, orInfo.plist. Compiling to Hermes bytecode raises casual inspection effort, but string tables remain extractable — private API credentials and signing secrets must stay on backend servers. - Over-permissive native bridges and
react-native-webviewexposure (MASVS-PLATFORM): Custom Native Modules, TurboModules, andreact-native-webviewbridges (onMessage,injectedJavaScript) can expose privileged native functions to untrusted pages whenoriginWhitelistis overly broad or file/content access stays enabled. Cross-check WebView hardening against our Android WebView security guide. - Unverified over-the-air (OTA) bundle updates (MASVS-CODE, MASVS-NETWORK): OTA frameworks such as Expo Updates or CodePush-style channels replace JavaScript or Hermes bundles outside store review. Without strict HTTPS transport, cryptographic bundle signature verification, and isolated release channels, a compromised update endpoint can inject arbitrary code into installed clients.
Packaging and platform boundaries
Accurate React Native testing depends on inspecting the complete release artifact rather than a partial download. On Android, Play App Bundles split native libraries such as libhermes.so, libreactnative.so, and native module .so binaries into ABI splits like split_config.arm64_v8a.apk. Scanning only base.apk misses those native binaries and causes real-device installs to fail with INSTALL_FAILED_MISSING_SPLIT or UnsatisfiedLinkError. Export a signed .apks archive via bundletool as documented in our Android split APK testing guide.
On iOS, App Store IPAs are protected by Apple FairPlay DRM (cryptid=1). While main.jsbundle and Info.plist sit outside the encrypted Mach-O text segment, static inspection cannot analyze encrypted Swift/Objective-C executables or embedded native frameworks. Always export an unencrypted development or ad-hoc IPA (cryptid 0) from CI or Xcode; follow our iOS IPA FairPlay testing guide before running static or device checks.
Static review vs real-device proof and CI SARIF gating
Static analysis of an Android .apk or signed .apks split archive (exported from an .aab via bundletool) and an unencrypted iOS IPA surfaces candidate issues rapidly: manifest and ATS exceptions, insecure storage APIs, WebView configuration risks, native binary flags, and embedded URLs or keys across both native code and JS/Hermes assets. Authorized runs on physical Android and iPhone hardware then verify concrete runtime evidence — clean multi-split installation, foreground launch, passive Android FLAG_SECURE checks, masked runtime log-canary checks, and optional Record Mode traffic captures under a signed scope.
Validator boundaries and partial coverage: Static findings remain candidates for human validation rather than automatically confirmed vulnerabilities. Automated device stages report partial dynamic coverage: encrypted HTTPS traffic stays unmeasured without an authorized capture, and AWS public iPhone re-signing does not prove production App Store entitlements.
To integrate React Native checks into GitHub Actions or GitLab CI without noisy false blocks, upload build artifacts and export SARIF with --allow-partial as shown in CI/CD integration. Check supported archive rules under scan profiles, inspect redacted evidence in our sample reports, and review pilot options on pricing and pilots.