How I Bypassed In App Purchases In A Capacitor App With 20 Lines Of Frida Part 2
The in-app purchase plugin never configured a billing public key, so purchase signatures were never verified. An attacker with Frida could hook the purchase callback and inject a forged purchase response, unlocking premium content without paying.
Published on systemweakness.com
In the first part of this article, I showed how I discovered a vulnerable implementation of a Cordova plugin used for in-app payments. If you haven’t read it yet, I highly recommend checking it out first!
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 plugin's public billing key was never configured, so the app skipped signature verification and trusted whatever purchase data reached its callback.
Impact
An attacker could unlock premium content without any real payment, and the bypass works whether the user taps Buy or Cancel; the demo's consume error code differs from a real app's but does not affect the bypass.
What the attacker needed
Android device with USB debugging; Frida installed on the host; the demo APK installed
The fix
The app should configure the Google Play public key and verify each purchase signature before processing it, and ideally validate purchase tokens server-side against Google's API.
How it was found
- Install the demo APK on an Android device with USB debugging enabled.
- Attach Frida to the app in spawn mode with the bypass script.
- Tap Unlock on a locked content card to trigger the purchase dialog.
- The hook intercepts the purchase update and replaces it with a synthetic success response.
- The hook forces the consume response to success, firing the purchaseConsumed event.
- The locked cards disappear and the premium content is shown.
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 are confirmed by a message from Google Play that includes a signature, a kind of digital stamp proving the purchase is real. This app never set up the key needed to check that stamp, so it accepted any message claiming a purchase had happened. Someone with a tool called Frida, which can change an app's behaviour while it runs, could fake that message and unlock paid content 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.