Frida is a dynamic instrumentation toolkit that lets an authorised tester attach to a running Android app, hook Java and native methods, and change behaviour in memory without touching the APK on disk. For Indian fintech and neobank apps, this matters because static analysis alone misses logic that only executes at runtime — SSL pinning checks, root-detection routines, and crypto key handling. Under OWASP MASVS/MASTG, dynamic testing with Frida is the standard technique for verifying resiliency controls that static tools cannot fully validate. Used only on apps you own or are contracted to test, it turns "we assume this is secure" into evidence.
What Frida Actually Does at Runtime
Frida injects a JavaScript engine into the target process. From that vantage point, a tester can:
- Hook methods — intercept any Java method call (via
Java.perform) or native function (viaInterceptor.attach), read its arguments, and replace its return value. - Trace execution — log every call to a class or function to understand undocumented logic, such as how an app derives a device fingerprint.
- Tamper with control flow — force a boolean check (e.g.
isRooted()) to always returnfalse, or force a licence/subscription check to returntrue. - Inspect memory and crypto — dump keys, IVs, and plaintext right before or after encryption calls, even when the network traffic itself is encrypted and pinned.
Hooking Methods: Reading and Rewriting Logic Live
The most common Frida workflow on Android starts with Java.perform(), which gives access to the app's loaded classes. A tester enumerates classes with a target package name, picks a suspicious method — say, a validateTransaction() call in a payments SDK — and overrides its implementation to log arguments before calling the original method through. This reveals things a decompiled .smali file cannot: the actual value of a session token at the moment of an API call, whether a discount or fraud-score field is validated client-side (and therefore trivially bypassable), and whether sensitive data briefly exists in plaintext in a variable before encryption.
For native code (many fintech apps ship OTP verification, tokenisation, or anti-tamper logic in a .so library for obfuscation), Interceptor.attach() hooks the function at the assembly boundary, letting the tester dump register values on entry and exit — independent of whatever the Java layer around it does.
Setting Up a Frida Environment for Android Pentesting
Frida uses a client-server model: frida-server runs on the target device — a rooted physical Android device or a rooted emulator image such as Genymotion or a custom AVD — while the tester's frida-tools (installed on the host with pip install frida-tools) connect over USB or a forwarded port. The two sides must be architecture- and version-matched; running an ARM64 frida-server binary against an x86_64 emulator, or pairing a newer frida-tools release on the host with an older frida-server on the device, is the most common cause of "failed to attach" errors and hooks that silently never fire. A typical session starts with frida-ps -Uai to list installed packages on the connected device, then frida -U -f com.package.name -l script.js --no-pause to spawn the target app with the hook script attached from process start. Spawning rather than attaching to an already-running process matters for fintech apps specifically, because root-detection and pinning checks often run within the first few hundred milliseconds after launch — a late attach can miss the window entirely and produce a false "no protections found" result.
Know your vulnerabilities before attackers do
Run a free VAPT scan — takes 5 minutes, no signup required.
Book Your Free ScanBypassing Root Detection and SSL Pinning
Two checks dominate mobile app hardening reviews, and both are textbook Frida targets:
- Root/jailbreak detection — apps typically check for
subinaries, Magisk artifacts, or build tags. A single hook forcing the detection method's return value tofalsedisables the check for the test session, letting the assessment continue on a rooted device that more closely resembles a compromised end-user phone. - Certificate/SSL pinning — apps pin a certificate or public key to prevent man-in-the-middle interception, even over a legitimate TLS proxy like Burp Suite. Frida scripts (the community's
frida-multiple-unpinningapproach is widely referenced in MASTG) hook the app's TrustManager or OkHttpCertificatePinnerand force every certificate check to pass, so a tester can route traffic through an interception proxy and inspect API payloads that would otherwise be invisible.
Both bypasses matter for fintech specifically: they are the same techniques a malware author would use to intercept OTPs, session tokens, or account data from a repackaged or sideloaded version of a banking app running on a compromised device.
What Runtime Instrumentation Reveals About Insecure Storage and Logic
Once pinning and root checks are bypassed, dynamic testing typically surfaces a predictable set of issues, mapped to MASVS storage and crypto requirements:
| Finding class | What Frida reveals | MASVS/MASTG reference |
|---|---|---|
| Hardcoded or derivable crypto keys | Key material visible in memory or logged before an AES call | MASVS-CRYPTO |
| Client-side-only business logic | Fraud score, discount, or KYC checks can be forced to pass | MASVS-RESILIENCE |
| Plaintext data in transit briefly | Sensitive fields visible pre-encryption in a hooked method | MASVS-CRYPTO-1 |
| Weak/ineffective root detection | Single hook disables all checks, no secondary validation | MASVS-RESILIENCE-1 |
| Sensitive data in shared prefs/logs | Values traced from a hooked setter into insecure storage APIs | MASVS-STORAGE-1 |
Defence: What Actually Slows Down a Frida-Capable Attacker
Obfuscation and a single root-check are not defences against runtime instrumentation — they are speed bumps. A realistic MASVS-aligned defence-in-depth stack looks like this:
- RASP (Runtime Application Self-Protection) — detect Frida's own presence (its default server port, named pipes, injected library signatures, and TracerPid anomalies) and respond by degrading functionality or terminating the session, rather than relying on a single boolean check.
- Multi-layered integrity checks — validate app signature, installer source, and code integrity at multiple points in the flow (not just at startup), so a bypass at one point doesn't compromise the whole session.
- Native-layer sensitive logic — move fraud/KYC-adjacent decisions and key handling into native code with anti-hooking checks (stack trace inspection, inline hooking detection), since native hooks require more attacker effort than Java-layer ones.
- Server-side validation as the real control — never trust a client-side check for anything that affects money movement or KYC status. Treat every client-side flag as advisory; re-validate on the server. This is the single control that neutralises most Frida-based tampering, because bypassing a client check achieves nothing if the server independently re-checks.
- Certificate pinning with fallback monitoring — pin certificates, but also monitor and alert server-side on TLS anomalies and unusual client behaviour, since pinning alone will eventually be bypassed by a sufficiently motivated attacker.
Bringing This Into a Structured Assessment
A one-off Frida session by an internal developer is useful for debugging; it is not a security assessment. A structured MASVS-aligned mobile pentest — static review, dynamic instrumentation, API testing behind the mobile layer, and a written report mapped to MASTG test cases — is what regulators and enterprise customers actually expect to see evidence of. For apps handling payments or KYC data, this dynamic layer is typically delivered with a CERT-In empanelled partner where a formal empanelled certificate is required for a tender or regulatory submission.
Fintech teams that want this validated on their own app, on their own authorised build, can start with a free VAPT scan run on Dhisattva AI Pvt Ltd's automated assessment platform, and route mobile-specific findings into a structured DPDP-aligned remediation plan — see DPDP compliance guidance for how storage and logging findings map to statutory obligations. More assessment methodology is available on the Bachao.AI blog.