[Hacking Bank] The Second Story of Finding Critical Vulnerabilities on Banking Application
The banking app signed each request with an HMAC key that was hardcoded in the app's settings, and the OTP-creation endpoint returned sensitive user data such as hashed passwords and account numbers given only a phone number. An attacker could then use the leaked account number to call other APIs without a session and read account details or send money.
Published on medium.com
This is new post about reversing a banking application that uses the “Xamarin” platform, bypassing the integrity of the requests and finding critical vulnerabilities that allow attackers to access the internal platform, obtain full user information (passwords, account balance, transaction list) even to send money just…
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.
Context
This write-up covers a security assessment of an Android banking application built on the Xamarin platform. The app talks to a backend API, and every request carries an ONB-CS header that the backend uses to verify the integrity of the request. The researcher's goal was to understand how that header is generated, reproduce it outside the app, and then test the API directly. Doing so exposed three issues: hardcoded credentials in the app that gave access to an internal platform holding all users' data, an OTP-creation endpoint that returned sensitive user data given only a phone number, and an IDOR on account-related API calls that allowed reading another user's full information and even sending money.
The report does not name the bank, the API host, or the app version.
Setup
- A rooted Android device running the banking application.
- Frida server running in the background on the device.
- frida_multiple_unpinning.js to disable SSL pinning and intercept traffic between the app and the API.
- Burp Suite (Repeater and Proxy history) to inspect and replay requests.
- JADX-GUI to read the Java source of the app.
- ILSpy, an open-source .NET assembly browser and decompiler, to decompile the DLL files.
- Sublime Text to search the decompiled C# code.
- Python to reimplement the signature function and automate requests.
- Proxychains to chain the Python requests through Burp Suite so they appear in Burp's history.
No accounts or roles beyond the app itself are described.
Finding it
With Frida unpinning SSL, all requests between the app and the API were visible in Burp.

Replaying a request after changing anything in Burp Repeater produced an error.

The ONB-CS header looked like the signature used to verify the request's integrity. The researcher moved to JADX-GUI to see how the header was generated, but found nothing interesting in the Java source: searching for the header name returned no results.

Searching the app's source and the web for the development platform revealed Xamarin SDK and DLL files under Resources > assemblies.

Xamarin extends .NET with tools and libraries for building Android, iOS, tvOS, watchOS, macOS and Windows apps using .NET and C#, which explains why DLL files appear inside an Android app.
To reverse the DLL, the researcher used ILSpy to decompile it and saved the output as plain C# so it could be opened in Sublime Text. Searching all C# files for ONB-CS located the function responsible for the signature.

The function hashes the request body using HMACSHA256 with a ClientSecret as the key. Searching for the next keyword, *****BankClientSecret, revealed critical information disclosed in the app settings: credentials that lead to an internal platform allowing the fetching of all users' data. This was the first vulnerability.

Exploitation
Step 1: Reimplement the signature in Python
To automate testing, the researcher rewrote the signature function in Python, doing the same thing: HMACSHA256 with ***BankClientSecret as the key.

The login function in Python was written to match the app's login request.

Running the script returned a valid response.

Proxychains was used to chain the Python requests through Burp Suite, so the requests could also be viewed in Burp's history.

Step 2: Look at what login returns
The login request did not return any session tokens in the response, which the researcher found odd. The next API call examined was GetAccountFullInfo, which takes only the account number as input.

Step 3: Find a second account number through the OTP endpoint
To test IDOR, a second account number was needed. Brute forcing the account number was considered but rejected as slow and likely to get the tester blocked. Instead, the researcher continued checking the app's other features and found that the create OTP request returns critical data: hashed password, hashed pin and account number, and it requires only the phone number. This was the second vulnerability.

Step 4: Obtain a victim's phone number
The researcher used LinkedIn to find someone who worked at the bank and obtained that person's phone number. The Python script was used to validate the signature check and send the request.

With that, all of the victim's details were returned.
Step 5: Test the IDOR on GetAccountFullInfo
Returning to the GetAccountFullInfo API, the researcher tested the IDOR with the victim's account number, and it was vulnerable.

Step 6: Test the other account APIs
Other API calls such as Get Statement and Sending Money were tested and worked as well. This was the third vulnerability.

Step 7: Full exploitation script
A Python script was written that requires only the victim's phone number to gather all of the user's information from the bank's API.

Root cause
The signature check ONB-CS HEADER appears to be the only security check in the backend of this API. The HMAC key (ClientSecret) is embedded in the app and was recovered by decompiling the Xamarin assemblies, so the researcher could produce valid signatures for requests. The signature check appears to be the only security check in the backend, and the account APIs did not enforce per-user authorisation.: GetAccountFullInfo takes only an account number, and the create OTP endpoint returns sensitive data given only a phone number. The login response did not return any session tokens, which the researcher found odd.
Impact
An attacker who extracts the client secret can sign requests to the API. With only a victim's phone number, the create OTP endpoint returns hashed password, hashed pin and account number. With the account number, GetAccountFullInfo returned the user's full information, and other calls such as Get Statement and Sending Money worked as well. The hardcoded credentials found in the app settings also lead to an internal platform that allows fetching of all users' data. The report does not quantify how many users were affected or whether the issues were fixed.
Fix
The report does not describe any remediation that was applied. Based on the findings, the client secret should not be embedded in the app, the backend should enforce per-user authorisation on every account API rather than relying on a request signature alone, and the create OTP endpoint should not return hashed credentials or account numbers.
Variants to test
- Xamarin apps with request signing: decompile
Resources > assembliesDLLs with ILSpy and search for header names or HMAC usage. A positive result is a signing function with a hardcoded key that you can reproduce in Python and replay successfully. - Endpoints that take only an identifier: try
GetAccountFullInfo-style calls with another user's account number. A positive result is a full profile returned for an account you do not own. - OTP or recovery endpoints: send only a phone number and inspect the response for hashed password, hashed pin, account number or other sensitive fields. A positive result is any of those fields returned before authentication.
- Login responses without session tokens: when login returns no token, check whether subsequent calls rely only on the signature. A positive result is any authenticated action succeeding with just a valid signature and an identifier.
- LinkedIn OSINT for phone numbers: use public profiles to obtain a target phone number, then feed it to the OTP endpoint. A positive result is the victim's data returned without any interaction from the victim.
What happened, in plain words
A security researcher looked at an Android banking app. The app talks to a computer system at the bank (the backend) to do everything: log in, show your balance, list your transactions, send money. Every message the app sends to that backend carries a small extra piece of data, a header called ONB-CS, which the backend uses to check that the message has not been tampered with.
The researcher wanted to understand how that header is produced. If you can produce it yourself, you can talk to the bank's backend directly, without the app, and send whatever messages you like. That is exactly what happened. Once the researcher could sign messages, three problems appeared:
- The app contained a hardcoded secret (a password-like value baked into the app itself) that gave access to an internal platform holding all users' data.
- A feature that creates a one-time code (OTP) returned sensitive user data, including a hashed password, a hashed PIN and an account number, when given only a phone number.
- Account-related calls accepted another user's account number, so that user's account could be read, and calls such as Sending Money worked, using a phone number found in public. This kind of flaw is called IDOR.
The report does not name the bank, the API address or the app version.
Background: the ideas you need
Before the steps, here are the concepts used throughout, explained from zero.
- App and backend. The app on the phone is the front end: the part you see and tap. The backend is a program on the bank's servers that holds the real data and does the real work. The app asks, the backend answers.
- API. An API is the set of addresses and rules the app uses to ask the backend for things. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen; you order through the waiter, using the menu's names. Each API call has a name (like
GetAccountFullInfo) and takes some inputs. - Request and response. A request is the message the app sends ("give me the info for account 123"). A response is the message the backend sends back (the account details, or an error).
- HTTP header. Extra labelled information attached to a request, separate from the main content. Like the envelope around a letter: the letter is the body, the envelope carries the address and stamps.
ONB-CSis one such header. - Signature and integrity. A signature is a short value computed from the content of a message plus a secret key. If anyone changes even one character of the message, the signature no longer matches. The backend recomputes it and rejects the request if it does not match. This is what "verifying the integrity of the request" means: checking the message was not altered. It is like a wax seal on an envelope: break the seal and the recipient knows.
- HMAC and HMACSHA256. HMAC is a standard way to build such a signature using a secret key. SHA256 is the hashing algorithm it uses inside. A hash turns any input into a fixed-length string of characters, and you cannot go backwards from the string to the input. With HMAC, only someone who knows the key can produce a matching signature.
- Client secret. The secret key used to compute the signature. If it lives inside the app, anyone who can open up the app can find it.
- SSL pinning. Normally your phone trusts many certificate authorities to vouch for websites. Pinning means the app only trusts one specific certificate, the bank's. This stops a person in the middle from reading the traffic. It also stops a tester from reading it, which is why the researcher had to disable it.
- Frida. A tool that lets you inspect and modify a running app on a phone. The researcher used a script to switch off SSL pinning so the traffic could be read.
- Rooted device. A phone where the owner has full administrator control, which many testing tools need.
- Burp Suite. A tool that sits between the app and the backend, records every request and response, and lets you edit and resend them. Like a postal worker who opens, copies and can rewrite letters before delivering them.
- Repeater. The part of Burp that resends a single request you have edited.
- JADX-GUI. A tool that opens an Android app package and shows its Java source code, so you can read what the app does.
- Xamarin and .NET. Xamarin is a way of building Android and iOS apps using .NET and the C# programming language instead of Java. .NET is a developer platform with tools, languages and libraries for building many kinds of applications. Because the app is written in C#, its compiled code is stored in DLL files, which is unusual inside an Android app.
- DLL and decompiler. A DLL is a compiled code file. A decompiler turns compiled code back into readable source code. ILSpy is an open-source .NET assembly browser and decompiler used here.
- Sublime Text. A text editor with a search-across-files feature, used to find a keyword in all the decompiled C# files at once.
- Python. A programming language often used for quick scripts. Here it was used to redo the signature calculation and send requests automatically.
- Proxychains. A tool that forces a program's network traffic through another program. Here it sent the Python requests through Burp, so they showed up in Burp's history.
- Session token. A short value a backend gives you after login, which you send with later requests to prove who you are, like a wristband at an event. The login response here did not contain one.
- OTP. One-time password: a short code sent to your phone to prove you own it.
- Hashed password and hashed PIN. A hash of a password or PIN is the result of running it through a one-way function. You cannot read the original from it, but it is still sensitive, and weak passwords can be guessed from it.
- IDOR. Insecure Direct Object Reference: when a request names an object (an account, a file, an order) by an identifier and the backend does not check that you are allowed to access that particular object. If changing the number in the request gives you someone else's data, it is an IDOR. Like a hotel where any room key opens any door as long as the room number is written on it.
- Brute force. Trying many values in sequence, here many account numbers, until one works.
- OSINT. Open-source intelligence: gathering information from public sources. Here, LinkedIn was used to find a bank employee and obtain their phone number.
1. Getting around the application
The first goal was to see the traffic between the app and the backend. The researcher started by checking the app's requests in Burp. To do that, Frida server had to run in the background on a rooted device, with the banking app running on it. The researcher used frida_multiple_unpinning.js to disable SSL pinning and intercept all requests between the app and the API.

The image shows the intercepted traffic in Burp: the requests the app sends to the API, now visible because pinning is off.
Next, the researcher changed something in a request and resent it with Burp Repeater. The result was an error.

The image shows that error after a request was edited in Repeater. A modified message is rejected, so something in the request is being validated. Something in the request is being validated.
That something looked like the ONB-CS header, which appeared to be the signature used to verify the request's integrity.
To find out how the header is generated, the researcher opened the app in JADX-GUI and read the Java source. There was nothing interesting there: searching for the header name found nothing.

The image shows the JADX-GUI search for the header name coming up empty. The reason is that the code doing the signing is not Java at all.
The researcher then searched the app's source and the web to find out which platform the app was built with, and found Xamarin SDK and DLL files under Resources > assemblies.

The image shows those DLL files inside the app's resources. Xamarin extends .NET with tools and libraries for building Android, iOS, tvOS, watchOS, macOS and Windows apps using .NET and C#. That explains why DLL files, which are .NET compiled code, sit inside an Android app: the signing logic is in C#, not Java, which is why the Java search found nothing.
To read the DLL, the researcher used ILSpy, an open-source .NET assembly browser and decompiler, decompiled the DLL files and saved the output as plain C# so it could be opened in Sublime Text. Then, using Sublime's search across files, the researcher searched all C# files for ONB-CS and located the function responsible for the signature.

The image shows the decompiled C# code where the signature function was located. This function hashes the request body using HMACSHA256 with a ClientSecret as the key. In plain words: it takes the content of the request, combines it with a secret key using the HMAC-SHA256 recipe, and the result is the signature. Anyone who knows the key can produce the same signature for any message.
Searching for the next keyword, *****BankClientSecret, revealed critical information disclosed in the app settings: credentials that lead to an internal platform allowing the fetching of all users' data. This was the first vulnerability.

The image shows where that secret was found in the app settings. The point is simple: a secret that lives inside the app is not secret. Anyone who downloads the app and decompiles it can read it, and with it they can sign their own requests and reach an internal platform that holds every user's data.
2. Testing the API
Step 1: Reimplement the signature in Python
With the signing function understood, the next step was to reproduce it outside the app, so requests could be generated automatically instead of by tapping through the app. The researcher rewrote the signature function in Python, doing the same thing: HMACSHA256 with ***BankClientSecret as the key.

The image shows the Python version of the signature function, which does the same thing as the app's: HMACSHA256 with the client secret as the key.
The login function in Python was written to match the app's login request.

The image shows the Python login function.
Running the script returned a valid response.

The image shows that valid response. This is the turning point: the researcher can now talk to the bank's backend directly, with correctly signed messages, without using the app at all.
Proxychains was used to chain the Python requests through Burp Suite, so the requests could also be viewed in Burp's history.

The image shows the Python requests appearing in Burp's history, which makes them easy to inspect and replay like any other traffic.
Step 2: Look at what login returns
The login request did not return any session tokens in the response, which the researcher found odd. A session token is what normally proves who you are on later requests. Without one, it is unclear how the backend knows which user is asking. The next API call examined was GetAccountFullInfo, which takes only the account number as input.

The GetAccountFullInfo call takes only the account number as input. If the backend does not check that the account number belongs to the caller, then anyone with a valid signature can ask for any account.
Step 3: Find a second account number through the OTP endpoint
To test IDOR, a second account number was needed: you cannot prove that you can read someone else's account without an account that is not yours. Brute forcing the account number was considered but rejected as slow and likely to get the tester blocked. Instead, the researcher continued checking the app's other features and found that the create OTP request returns critical data: hashed password, hashed pin and account number, and it requires only the phone number. This was the second vulnerability.

The create OTP request returns critical data: hashed password, hashed pin and account number. Think about what this means: a request that is supposed to send a code to a phone hands back a hashed password, a hashed PIN and the account number, and all it needs is a phone number. No password, no code, no proof that the phone belongs to the person asking.
Step 4: Obtain a victim's phone number
The researcher used LinkedIn to find someone who worked at the bank and obtained that person's phone number. The Python script was used to validate the signature check and send the request.

The image shows the response after sending the request with that phone number. With that, all of the victim's details were returned. The only input was a phone number found in public.
Step 5: Test the IDOR on GetAccountFullInfo
Returning to the GetAccountFullInfo API, the researcher tested the IDOR with the victim's account number, and it was vulnerable.

The researcher tested the IDOR with the victim's account number, and it was vulnerable.
Step 6: Test the other account APIs
Other API calls such as Get Statement and Sending Money were tested and worked as well. This was the third vulnerability.

Step 7: Full exploitation script
A Python script was written that requires only the victim's phone number to gather all of the user's information from the bank's API.

The image shows the script, which requires only the victim's phone number to gather all of the user's information from the bank's API. One public piece of information is enough to start.
Root cause
The signature check ONB-CS HEADER appears to be the only security check in the backend of this API. The HMAC key (ClientSecret) is embedded in the app and was recovered by decompiling the Xamarin assemblies, so the researcher could produce valid signatures for requests. The signature check appears to be the only security check in the backend, and the account APIs did not enforce per-user authorisation.: GetAccountFullInfo takes only an account number, and the create OTP endpoint returns sensitive data given only a phone number. The login response did not return any session tokens, which the researcher found odd.
In everyday terms: the backend checks that the envelope's seal is genuine, but never checks whether the person holding the envelope is allowed to open the letter inside. And the stamp used to make the seal was left inside the app for anyone to copy.
Impact
An attacker who extracts the client secret can sign requests to the API. With only a victim's phone number, the create OTP endpoint returns hashed password, hashed pin and account number. With the account number, GetAccountFullInfo returned the user's full information, and other calls such as Get Statement and Sending Money worked as well. The hardcoded credentials found in the app settings also lead to an internal platform that allows fetching of all users' data. The report does not quantify how many users were affected or whether the issues were fixed.
Fix
The report does not describe any remediation that was applied. Based on the findings, the client secret should not be embedded in the app, the backend should enforce per-user authorisation on every account API rather than relying on a request signature alone, and the create OTP endpoint should not return hashed credentials or account numbers.
Variants to test
- Xamarin apps with request signing: decompile
Resources > assembliesDLLs with ILSpy and search for header names or HMAC usage. A positive result is a signing function with a hardcoded key that you can reproduce in Python and replay successfully. - Endpoints that take only an identifier: try
GetAccountFullInfo-style calls with another user's account number. A positive result is a full profile returned for an account you do not own. - OTP or recovery endpoints: send only a phone number and inspect the response for hashed password, hashed pin, account number or other sensitive fields. A positive result is any of those fields returned before authentication.
- Login responses without session tokens: when login returns no token, check whether subsequent calls rely only on the signature. A positive result is any authenticated action succeeding with just a valid signature and an identifier.
- LinkedIn OSINT for phone numbers: use public profiles to obtain a target phone number, then feed it to the OTP endpoint. A positive result is the victim's data returned without any interaction from the victim.
Glossary
- API: the set of addresses and rules an app uses to ask a backend for data or actions, like a menu and waiter in a restaurant.
- Backend: the program on the bank's servers that holds the real data and does the real work.
- Front end: the part of the system the user sees and interacts with, here the phone app.
- Request: a message sent from the app to the backend asking for something.
- Response: the message the backend sends back.
- HTTP header: extra labelled information attached to a request or response, separate from the main content.
- Integrity: the property that a message has not been altered in transit or before processing.
- Signature: a short value computed from a message and a secret key, used to prove the message was not changed.
- HMAC: a standard method for building a signature from a message and a secret key.
- SHA256: a hashing algorithm that turns any input into a fixed-length string you cannot reverse.
- Hash: the output of a hashing algorithm; a one-way fingerprint of some input.
- Client secret: the secret key used to compute request signatures in this app.
- Hardcoded credential: a password, key or secret written directly into the app's code or settings, where anyone with the app can find it.
- SSL pinning: a setting that makes an app trust only one specific certificate, blocking interception of its traffic.
- Frida: a tool for inspecting and modifying a running app on a device.
- Rooted device: a phone where the owner has full administrator control.
- Burp Suite: a tool that records, edits and resends traffic between an app and a backend.
- Repeater: the Burp feature for editing and resending a single request.
- JADX-GUI: a tool that shows the Java source code inside an Android app.
- Xamarin: a way of building mobile apps with .NET and C#.
- .NET: a developer platform with tools, languages and libraries for building many kinds of applications.
- C#: a programming language used with .NET.
- DLL: a compiled code file used by .NET applications.
- Decompiler: a tool that turns compiled code back into readable source code.
- ILSpy: an open-source .NET assembly browser and decompiler.
- Sublime Text: a text editor with search across many files.
- Python: a programming language often used for automation scripts.
- Proxychains: a tool that forces a program's traffic through another program, here Burp.
- Session token: a value given after login that proves who you are on later requests.
- OTP: one-time password, a short code sent to a phone to prove ownership.
- Hashed password / hashed PIN: the one-way hash of a password or PIN, still sensitive even though the original cannot be read directly.
- IDOR (Insecure Direct Object Reference): a flaw where a request names an object by identifier and the backend does not check the caller is allowed to access it.
- Brute force: trying many values in sequence until one works.
- OSINT: open-source intelligence, gathering information from public sources such as social media.
- Endpoint: a specific API address that performs one function, such as
GetAccountFullInfo. - Per-user authorisation: a backend check that the caller is entitled to the specific data or action requested.