Grep Said No Pinning. The App Pinned Anyway
A mobile banking app's certificate pinning was implemented by hand rather than through a pinning library, so standard hooking scripts silently failed, and the app's hostname verifier accepted any hostname. The author also found a background watchdog that killed the process, a device-trust token that skipped the OTP on later logins, and client-side RSA encryption of credentials.
Static analysis on this one started the way it always does: decode the APK, then grep for the usual suspects.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the app built its own trust store and socket factory from platform primitives instead of using a pinning library, and paired it with a hostname verifier that always returns true.
Impact
The always-true hostname verifier removes a layer of defence in depth, so a certificate signed by the single embedded authority for the wrong name would be accepted; the trust store itself still limits what an attacker can present.
What the attacker needed
Ability to install a user CA on the device; instrumentation framework such as Frida; a rooted test device
How it was found
- Decode the APK and search the smali for pinning library classes and a network security config, finding none.
- Identify the surviving library class and match method shapes and string literals to confirm the HTTP library is present.
- Locate the hand-rolled socket factory and the hostname verifier that always returns true.
- Hook the platform SSL context initialisation to drop the app's trust managers and fall back to the system store.
- Observe a certificate error on some requests and add hooks on the platform trust manager and pin retrieval.
- Confirm a live login completes through the intercepting proxy with a real session token.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Apps often check that they are talking to the right server by trusting only one specific certificate authority, a bit like only accepting letters with one particular wax seal. This app did that check with homemade code instead of a standard library, so common tools that look for the library found nothing and wrongly concluded there was no check. Separately, the app accepted any server name once the seal matched, which removes a safety net if that one authority ever made a mistake.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.