Skip to content
Business logic Write-up Intermediate

Use Case: Bypassing In-App Purchase By Payment Client-Side Validation

The Android file manager app validates in-app purchases on the client side, so an attacker with local access can use Frida to hook billing methods and fake a successful purchase. This unlocks premium features without paying.

secfathy0x1 Follow

Published on secfathy0x1.medium.com

Many Apps like LuckyPatcher and Etc can do this scenario but the goal of this blog to inform a software engineer’s about IAP Issues

Mohamed K. Fathy, on secfathy0x1.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 performs purchase validation entirely on the client side instead of verifying the purchase token with a backend server.

Impact

An attacker with local access to the device could unlock premium features without paying; the vendor did not consider it a problem and did not fix it.

What the attacker needed

Local access to the Android device; ability to run Frida on the device; the target app installed

The fix

Purchases should be validated on a backend server using Google's API, with code obfuscation and tamper detection as additional measures.

How it was found

  1. Decompile the APK with Jadx to find the billing classes and methods.
  2. Use Frida to hook the querySkuDetailsAsync method and return fake purchase details.
  3. Hook the validatePurchase method to always return true.
  4. Hook the premium check method in ProActivity to always return true, unlocking premium features.

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.

In-app purchases let you pay to unlock extra features. This app checked whether you paid using code running on your own phone, which someone can change. By using a tool called Frida to alter that check, a person could make the app think a payment was made and get the premium features for free.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.