Skip to content
Account takeover Write-up Intermediate

Write-up: KYC Me If You Can — Bypassing Biometric Verification via Native JWT Injection

The Android app hardcoded an HMAC signing secret and generated liveness JWTs entirely on the client, so an attacker could forge tokens with privileged identity claims. By hooking the JWT builder at runtime, the attacker bypassed biometric checks and obtained the protected flag from the server.

mr.abdulbasithk.p Follow

Published on medium.com

In modern Android applications, financial and high-security platforms rely heavily on Know Your Customer (KYC) workflows consisting of facial liveness verification followed by server-side identity checks. While standard implementations use machine learning models on the device or server, critical security…

4b6o0t, on medium.com

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 embedded a static HMAC secret in the APK and generated liveness JWTs client-side, so the server could not distinguish a genuine token from a forged one.

Impact

An attacker could bypass biometric liveness verification and impersonate a privileged user to retrieve the protected flag.

What the attacker needed

Android device or emulator; Frida installed and running; App installed (com.mobilehackinglab.kyc)

The fix

The app should not sign authorization tokens on the client; the server must generate and validate session tokens after verifying liveness server-side.

How it was found

  1. Reverse the APK with JADX to find the hardcoded secret and token generation logic.
  2. Write a Frida script that hooks JwtBuilder.compact() to add privileged claims.
  3. Use the app's own generateLivenessToken method to sign the modified token.
  4. Call startLivenessSession, verifyFace, and getFlag with the forged token.
  5. Capture the server response containing the flag.

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.

The app created a security token on the phone itself using a secret key that was baked into the app. Because the phone is controlled by the user, anyone could use that key to make their own token claiming to be an admin. The server trusted these tokens without checking whether the phone had actually performed the face scan.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.