Cross-Platform Framework Testing
Cross-platform frameworks like Flutter, React Native, and Xamarin present unique challenges for security testing due to their non-native runtimes and bundled code.
Framework Detection
Flutter
libflutter.soin APKFlutter.frameworkin IPAkernel_blob.binfile- Dart snapshots
React Native
index.android.bundlemain.jsbundle(iOS)libreactnativejni.soassets/JS files
Xamarin
libmonodroid.so*.dllassembliesXamarin.*.dllfilesassemblies/folder
# Detect framework from APK
apktool d target.apk -o decompiled
# Flutter detection
ls decompiled/lib/*/libflutter.so
ls decompiled/assets/flutter_assets/
# React Native detection
ls decompiled/assets/index.android.bundle
ls decompiled/lib/*/libreactnativejni.so
# Xamarin detection
ls decompiled/assemblies/*.dll
ls decompiled/lib/*/libmonodroid.soDetection decides which toolchain the rest of the engagement needs, so record the runtime as well as the framework: a Dart snapshot, Hermes bytecode, a plain JavaScript bundle and a .NET assembly do not read the same way twice, and the extraction command that worked is part of the result. Tie the artefact to the shipped build with the hash of the extracted bundle or assembly and the path it came from, because a screenshot of a directory listing says nothing about which build it described.
Two Runtimes, Two Assumptions
A Flutter app's business logic is Dart compiled ahead of time into
libapp.so
on Android and into the app binary on iOS. No Java or Kotlin class holds the decision, so a Java
hook sees the shell of the app rather than the rule it enforces. The logic still surfaces in three
places: the platform channel boundary, whatever native plugin sits underneath a package, and
BoringSSL for TLS. That is why the Flutter bypass in this section is a native hook rather than a
Java one.
React Native inverts it. The logic ships as JavaScript —
assets/index.android.bundle
on Android, main.jsbundle
on iOS — which can be read, and sometimes replaced and re-signed into the build. A Hermes build
keeps bytecode in that same file, still specific enough to name endpoints and strings. If
index.android.bundle
is absent, the build names its bundle differently or supplies it after install from an update
service; neither means there is no JavaScript, so look at what the app loads before concluding
anything.
Neither framework is a security boundary. Both inherit the platform's storage — the keystore or keychain, and the network security config or App Transport Security rules — and both ship whatever they are given in an artefact the user can read. A validation written in Dart or in JavaScript runs on the client, so hooking it shows where a rule lives; whether the server enforces the same rule is the finding.
Flutter Security Testing
Flutter Challenge
libapp.so (Android) or the app binary (iOS).
SSL Pinning Bypass
Flutter uses its own HTTP client that doesn't respect system proxy settings by default:
# Method 1: Patch libflutter.so to disable SSL verification
# Download reFlutter
pip install reflutter
# Patch APK
reflutter target.apk
# Install patched APK
adb install target-reflutter.apk
# Configure proxy (reFlutter adds proxy support)
# App will now route through your proxyFrida Flutter Hooks
// Hook Flutter's HTTP client
// Flutter uses BoringSSL at the native level, so there is no Java bridge to hook
var sslVerify = Module.findExportByName('libflutter.so', 'ssl_verify_peer_cert');
if (sslVerify) {
Interceptor.attach(sslVerify, {
onLeave: function(retval) {
console.log('[+] SSL verify bypassed');
retval.replace(0);
}
});
}
// Alternative: hook ssl_crypto_x509_session_verify_cert_chain
var verifyCert = Module.findExportByName('libflutter.so', 'ssl_crypto_x509_session_verify_cert_chain');
if (verifyCert) {
Interceptor.attach(verifyCert, {
onLeave: function(retval) {
retval.replace(1);
}
});
}Extracting Dart Code
# Extract Flutter snapshot for analysis
# Clone Doldrums (Dart snapshot analyzer)
git clone https://github.com/nicr0nd/Doldrums.git
cd Doldrums
# Extract snapshot from APK
unzip target.apk -d apk_extracted
cp apk_extracted/lib/arm64-v8a/libapp.so .
# Use Doldrums to extract Dart info
python3 doldrums.py libapp.so
# Alternative: Use darter for snapshot analysis
pip install darter
darter libapp.so --output dart_snapshot.jsonPlatform Channels as the Seam
Method channels and event channels are where Dart and native code exchange messages, and that
crossing is where a hook still exists when the Dart side is opaque. A Dart call arrives on the
Java or Kotlin side as an encoded message handled by
MethodChannel$IncomingMethodCallHandler.onMessage,
and native code calling into Dart leaves through
MethodChannel.invokeMethod.
Hooking either prints a method name and an argument object; the payload is StandardMethodCodec
encoded, so the method name and the byte count are the cheap signals, and decoding the buffer
needs the codec.
// Dart -> native: an inbound channel call arrives as an encoded message
Java.perform(function () {
var Handler = Java.use('io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler');
var origOnMessage = Handler.onMessage;
origOnMessage.implementation = function (message, reply) {
console.log('[dart -> native] ' + message.remaining() + ' bytes');
return origOnMessage.call(this, message, reply);
};
});What that proves is bounded. It shows which calls cross the boundary and with what arguments, not what the Dart code decided before or after. A missing call matters as much as a present one: if the app checks a value in Dart before sending it, what you see crossing is the result of that check, and the check itself never leaves the device.
React Native Security Testing
Extracting JavaScript Bundle
# Extract APK
apktool d target.apk -o decompiled
# Find JS bundle
cat decompiled/assets/index.android.bundle
# If bundle is minified, beautify it
npm install -g js-beautify
js-beautify index.android.bundle > bundle_pretty.js
# Search for sensitive data
grep -iE "api_key|password|secret|token" bundle_pretty.js
grep -i "https://" bundle_pretty.js # Find API endpointsHermes Bytecode Extraction
Modern React Native apps often use Hermes engine with bytecode:
# Check if using Hermes (look for HBC header)
xxd decompiled/assets/index.android.bundle | head
# If starts with "c6 1f bc 03" it's Hermes bytecode
# Decompile Hermes bytecode
# Install hermes-dec
npm install -g hermes-dec
# Decompile
hermes-dec index.android.bundle -o decompiled_js/
# Alternative: hbctool
pip install hbctool
hbctool disasm index.android.bundle output.hasmReact Native Frida Hooks
// Hook React Native networking
Java.perform(function() {
// Hook OkHttp (React Native uses it on Android)
var OkHttpClient = Java.use('okhttp3.OkHttpClient$Builder');
OkHttpClient.build.implementation = function() {
console.log('[+] OkHttpClient.build() called');
return this.build();
};
// Hook AsyncStorage
var AsyncStorage = Java.use('com.facebook.react.modules.storage.AsyncStorageModule');
AsyncStorage.multiGet.implementation = function(keys, callback) {
console.log('[AsyncStorage] Getting keys: ' + keys);
return this.multiGet(keys, callback);
};
// Intercept JS bridge calls
var ReactBridge = Java.use('com.facebook.react.bridge.CatalystInstanceImpl');
ReactBridge.jniCallJSFunction.implementation = function(module, method, args) {
console.log('[RN Bridge] ' + module + '.' + method + '(' + args + ')');
return this.jniCallJSFunction(module, method, args);
};
});SSL Pinning Bypass
// React Native typically uses native networking
// Bypass with standard OkHttp hooks (Android)
Java.perform(function() {
var CertificatePinner = Java.use('okhttp3.CertificatePinner');
CertificatePinner.check.overload('java.lang.String', 'java.util.List').implementation = function(hostname, certs) {
console.log('[+] RN CertificatePinner bypassed for: ' + hostname);
return;
};
});
// For iOS, hook AFNetworking or NSURLSession
if (ObjC.available) {
var AFSecurityPolicy = ObjC.classes.AFSecurityPolicy;
if (AFSecurityPolicy) {
Interceptor.attach(AFSecurityPolicy['- setSSLPinningMode:'].implementation, {
onEnter: function(args) {
args[2] = ptr(0); // AFSSLPinningModeNone
}
});
}
}Xamarin Security Testing
Decompiling .NET Assemblies
# Extract assemblies from APK
apktool d target.apk -o decompiled
ls decompiled/assemblies/
# Decompile with dnSpy (Windows) or ILSpy
# For Linux/Mac, use:
pip install dnfile
# Or use avalonia-ilspy
# Using ILSpy CLI
ilspycmd decompiled/assemblies/App.dll > decompiled_code.cs
# Search for sensitive data
strings decompiled/assemblies/*.dll | grep -i "password|secret|api"Xamarin Frida Hooks
// Hook Xamarin/Mono runtime
Java.perform(function() {
// Find Mono methods
var monoClasses = [];
Java.enumerateLoadedClasses({
onMatch: function(className) {
if (className.includes('mono') || className.includes('Xamarin')) {
monoClasses.push(className);
}
},
onComplete: function() {
console.log('Found Mono classes: ' + monoClasses.length);
}
});
// Hook HTTP client
try {
var HttpClient = Java.use('System.Net.Http.HttpClient');
console.log('[+] Found HttpClient');
} catch(e) {
// Try alternative location
var WebRequest = Java.use('System.Net.WebRequest');
WebRequest.Create.overload('java.lang.String').implementation = function(url) {
console.log('[WebRequest] URL: ' + url);
return this.Create(url);
};
}
});Common Cross-Platform Vulnerabilities
| Vulnerability | Impact | Where to Look |
|---|---|---|
| Hardcoded Secrets | Critical | JS bundles, Dart snapshots, .NET assemblies |
| Exposed API Endpoints | High | Decompiled source code |
| Insecure WebView | High | In-app browsers, OAuth flows |
| Client-Side Logic | Medium | Business logic in JS/Dart |
| Debug Mode Enabled | Medium | Verbose logging, debug menus |
| Source Maps Included | Medium | assets/*.map files |
A key-shaped constant in a Dart snapshot or a JavaScript bundle may be a public identifier or a test fixture, so verify that it authenticates before reporting it as a secret; a key with no privilege, or one the server has already revoked, is a hygiene finding rather than a live exposure. The same caution applies to logic — hooking a Dart or JavaScript validation shows where a rule lives, and whether the server enforces it is the finding. Obfuscation belongs in that category too: AOT compilation and Hermes bytecode raise the effort a tester must spend and nothing more, and a stripped source map makes reverse engineering harder without being a security control.
Recommended Tools
reFlutter
FlutterFramework for Flutter reverse engineering. Patches libflutter.so for SSL bypass and proxy support.
Installation
pip install reflutterhermes-dec
React NativeDecompiler for React Native Hermes bytecode bundles.
Installation
npm install -g hermes-decILSpy
XamarinOpen-source .NET assembly browser and decompiler for Xamarin apps.
Installation
# Download from releasesBlutter
FlutterFlutter/Dart reverse engineering toolkit. Extracts Dart code from snapshots.
Installation
git clone https://github.com/nicr0nd/blutterTesting Checklist
A silent proxy is a configuration problem before it is a pinning result. Flutter and React Native may ignore the system proxy entirely, so a proxy that records nothing from one of these frameworks should be treated as an unconfigured interception until a patched build or an explicit client configuration says otherwise. Confirm too that the artefact analysed is the release build, since debug and profile builds keep inspection hooks that release builds strip.
- Identify cross-platform framework used
- Extract and decompile bundled code
- Search for hardcoded credentials/API keys
- Map API endpoints from source
- Bypass SSL pinning for traffic interception
- Check for debug/development modes
- Test WebView security if present
- Verify client-side validation isn't sole control
- Look for source maps or debug symbols
Framework-Specific Proxy Issues
Practice Lab
Build a Flutter APK of your own, pull the Dart snapshot out of it and read what survives in the strings, then repeat the exercise against a React Native bundle — twice each, with and without obfuscation — done when you can name which artefacts are extractable and what obfuscation changed.
Evidence to Capture
Framework and runtime version: The detected framework, its version, and the runtime artefact: a Dart snapshot, Hermes bytecode, a JavaScript bundle or a .NET assembly.
Bundle hash: The SHA-256 of the extracted bundle, snapshot or assembly, with the path it came from.
Extraction command: The tool, its version and the command used.
Decompiled excerpt: The specific string, URL or logic path with file and offset.
Hook output: The Frida script for the runtime in question, and its console output including which module was attached.
Interception proof: A proxy entry for a request the app made after a pinning bypass.
Likely False Positives
- String found, not a secret: A key-shaped constant that never authenticates.
- Secret already rotated or scoped: A credential with no privilege, or one already revoked.
- Missing source map: A stripped source map.
- Obfuscation read as protection: AOT or Hermes bytecode treated as a control.
- Debug build behaviour: A debug or profile build with inspection hooks intact.
- Client-side check bypassed: A Dart or JavaScript validation hooked.
- Proxy failure attributed to pinning: A proxy that recorded nothing from the framework.
Remediation & Defense
Client
- • Move secrets and privileged endpoints off the bundle and behind an authenticated server call
- • Enforce validation on the server rather than in Dart or JavaScript
- • Remove debug hooks, developer menus and verbose logging from release builds
- • Obfuscate where it raises cost, but do not treat it as a control
- • Pin the API base URL and integrity check at build time rather than reading them from a bundled config
Transport
- • Apply pinning through the platform HTTP stack so it survives the framework layer
- • Configure the framework HTTP client explicitly for the test proxy in test builds only
- • Reject cleartext at the framework layer as well as the platform layer
Build pipeline
- • Scan bundles for secret patterns as a release gate
- • Fail the build on committed environment or keystore files inside app assets
- • Record the framework and runtime version in the build metadata so retests are comparable
Detection
- • Monitor for the leaked credential in use at the API, not only in the bundle
- • Alert on requests that omit the expected client attestation headers
- • Rotate any credential found in a bundle as an incident, not only as a finding