Certificate Pinning Bypass
The analyst problem of getting an app to accept an intercepting proxy’s certificate despite a narrowed trust store (pinning) or a non-platform TLS stack — a precondition for inspecting mobile API traffic, and the control whose strength MASVS-NETWORK measures.
Why interception got hard
Everything rests on whether the app trusts the tester’s CA. Android has removed the easy paths in stages, so interception is now a layered problem rather than one setting:
| Layer | What it blocks | Introduced |
|---|---|---|
| User CA store ignored | Apps targeting API 24+ trust only system CAs unless network_security_config opts in | Android 7 |
| No CA-install prompt | Apps can no longer prompt the user to add a CA | Android 11 |
| System store immutable | Trust store moved into the Conscrypt APEX module, mounted per process; old /system remounts break | Android 14 |
| CT required by default | Apps targeting API 37 on Android 17 reject system-trusted certs without SCTs (NOT_ENOUGH_SCTS) | Android 17 |
| App-level pinning | OkHttp CertificatePinner, custom TrustManager, bundled .bks/.jks truststores, pinned SPKI hashes | per app |
| Own TLS stack | Flutter ships BoringSSL in libflutter.so with its own CA list and never reads the Android config | framework |
On iOS the equivalent work is done through the instrumentation toolchain rather than trust-store edits (see Frida, Jailbreak and Root Detection Bypass).
Why pinning exists (and its limits)
Pinning is a legitimate control, not just an obstacle. The 2025 eMudhra incident — intermediate certs generated with trivially guessable private keys, undetected ~18 months, then cross-signed by a major CA — is the standard argument: an app that talks to a handful of endpoints should not trust all ~75 root owners in the OS store. NowSecure’s guidance is to pin vetted roots or intermediates, not leaves, so certificate rotation doesn’t brick already-installed apps, and to fail closed. CRL, OCSP and CT are weaker fallbacks because on Android they largely fail open or are disabled.
The limit is the trust model: any pin lives inside a binary the attacker controls on their own device, so on a rooted/jailbroken test device a determined analyst gets through. Pinning raises the cost of passive MitM for ordinary users; it is not a substitute for server-side authorization (Broken Access Control) or attestation.
The spectrum of approaches (what research describes)
Tooling and writeups describe a rough escalation, from cheapest to most involved:
- Trust-store level — installing or repackaging a proxy CA as a system/NSC trust anchor. Defeats apps with no pinning at all. The Android 17 CT change breaks this class of tooling (HTTP Toolkit, AdGuard Cert); HTTP Toolkit’s published workaround is to run private CT logs so its forged leaves carry SCTs, exploiting that clients don’t verify inclusion proofs.
- Generic runtime instrumentation — Objection’s
sslpinning disable, Frida CodeShare’sfrida-multiple-unpinning, Xposed modules (TrustMeAlready, SSLUnpinning), and HTTP Toolkit’sfrida-interception-and-unpinning(which also redirects traffic, injects a CA, patches CT checks and forces HTTP/3 down to TCP). These hook well-known validation entry points such as Conscrypt’sTrustManagerImpl.verifyChain. - Static patching —
apk-mitmand manual smali edits to pinned hashes or bundled truststores, then repackage/re-sign. MASTG-TECH-0012 documents the file locations andkeytoolround-trip for BKS stores. - Obfuscated custom pinning — fingerprint the library from residual strings/licence files, then hook or rewrite its known API (e.g. R8-mangled OkHttp
CertificatePinner.Builder.add). - Non-platform / native stacks — patch the verifier inside the native library. Crossfyre’s writeup identifies Flutter’s
ssl_crypto_x509_session_verify_cert_chainin a stripped (not obfuscated)libflutter.sostructurally — it is the one function cross-referencing bothssl_clientandssl_server— rather than by brittle byte signatures that fail silently across engine versions.
Flutter tells: Firebase/Crashlytics traffic (ordinary Java stack) decrypts while the app’s own API fails, often as a generic “no internet” rather than a TLS error; Dart also ignores the system proxy. Analysts report that individual tools (ReFlutter, Objection, stock scripts) each failed and only covering every validation path at once worked.
Notable cases
- Obfuscated FinTech app: OkHttp3
CertificatePinnerplus a customTrustManagerunder ProGuard, bypassed by hooking the pinner and verify path, exposing transaction endpoints (Omar Adel). - ShipFast demo pinned via NSC, intercepted with Frida + mitmproxy on an emulator (Approov).
- Android 17 CT rollout breaking system-CA interception tooling (
NET::ERR_CERTIFICATE_TRANSPARENCY_REQUIRED). - AndroGoat (OWASP training app): one endpoint over plain HTTP; HTTPS to
owasp.orgdecrypted once Burp’s CA was trusted becausenetwork_security_config.xmlheldcleartextTrafficPermitted="true"and<certificates src="user"/>; OkHttp3CertificatePinner.checkhooked with Frida to always pass; the NSC<pin-set>disabled with Objectionandroid sslpinning disableAndroGoat network, AndroGoat.
Defenses and verification
- Pin vetted root/intermediate SPKIs via NSC
<pin-set>or OkHttpCertificatePinner, with a backup pin, failing closed. - Expect pinning to be bypassable on an attacker-owned device; pair it with server-side authZ and attestation rather than treating client TLS as API protection.
- Remove
<certificates src="user"/>and setcleartextTrafficPermitted="false"; pair pinning with root and hook detection and alert on bypass attempts; add application-level encryption for the most sensitive payloads so a successful interception still yields ciphertext AndroGoat network. - MASVS-NETWORK; verify with MASTG-TEST-0022 (custom stores and pinning) and MASTG-TEST-0236 (cleartext traffic).
Related
- Mobile Application Security · Frida · Android App Security · iOS App Security · Jailbreak and Root Detection Bypass · OWASP Mobile Top 10
Sources
- Bypassing Certificate Pinning (OWASP MASTG) · original
- Android 17 enables certificate transparency, and breaks custom CAs · original
- Defeating Android Certificate Pinning with Frida · original
- Four Ways to Bypass Android SSL Verification and Certificate Pinning · original
- frida-interception-and-unpinning · original
- Certificate Pinning for Mobile Apps: Lessons from the eMudhra CA Incident · original
- Locating Flutter's TLS certificate verifier in a stripped libflutter.so · original
- I Wasted 3 Days Intercepting a Flutter App · original
- SSL pinning bypass on an Android FinTech app via Frida · original
- Bypassing Certificate Pinning Using Frida (Approov) · original
- Frida and Burp Suite on an Android emulator on Apple Silicon · original
- Mobile App Tampering and Reverse Engineering (OWASP MASTG) · original
- Android network interception: HTTPS and pinning bypass with Burp · original
- 33 Cracks in the Armor: Hacking AndroGoat · original