Skip to content
Business logic Write-up Intermediate

Bypassing a Payment Gateway Through Smali-Level Dead Code Discove

The mobile app's payment routing logic accepted a literal string 'null' as a valid payment gateway, which caused the server to mark orders complete without processing any charge. An attacker could bypass payment entirely by tampering with the payment_gateway parameter.

Abdullah Almuntaser Follow

Published on medium.com

During a recent engagement with a mobile application that handled financial transactions, I identified a critical business logic vulnerability that allowed complete circumvention of the payment gateway. The attack chain combined SSL pinning bypass, man-in-the-middle (MITM) traffic analysis, and static reverse…

Abdullah Almuntaser, 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 server trusted a client-supplied payment_gateway value and included a debug-only 'null' branch that marked orders complete without charging.

Impact

An attacker could complete orders without paying, as the server accepted the 'null' gateway and marked the order fulfilled with zero charge.

What the attacker needed

Ability to intercept app traffic; knowledge of the 'null' value; a valid order

The fix

The server should verify payment server-to-server with the payment processor and remove debug-only payment paths from production builds.

How it was found

  1. Bypass certificate pinning with Frida to intercept HTTPS traffic.
  2. Capture the payment request and note the payment_gateway parameter.
  3. Try common gateway values and observe server rejections.
  4. Decompile the APK and search for payment_gateway references in smali.
  5. Find the 'null' case in the dispatch logic that calls markOrderComplete().
  6. Replace payment_gateway with 'null' and remove card_token, then forward the request.

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 sent a payment choice to the server, and the server trusted it. A hidden option called 'null' was left in the app's code, and the server treated it as a real payment method that skipped charging the customer. Anyone who found that option could get orders 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.

More by Abdullah Almuntaser

View all

1 more disclosed report, best first.

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.