Hacking Razer Pay Ewallet App
The Razer Pay Android app protected API requests with a client-side signature, but the signing algorithm could be reverse engineered and recalculated, allowing tampering with parameters. This enabled IDOR attacks such as deleting another user's bank account, adding oneself to private chat groups, and viewing or modifying other users' data.
Published on blog.sambal0x.com
This write-up is about hacking the Razer Pay Android app - an E-Wallet app used in Singapore and Malaysia. It was an interesting journey worth blogging due to the use of some interesting techniques including Frida, a tool that I only thought was meant for bypassing SSL-pinning or root detection.
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
Razer Pay is an Android e-wallet app used in Singapore and Malaysia. The app talks to a backend over HTTP APIs, and every GET and POST request that reaches the server carries a calculated signature field. The field protected request payloads against tampering: modifying parameters produced an error response.

The write-up covers a set of IDOR issues found behind that signature scheme, including reading other users' chat messages, deleting another user's bank account, viewing private information and taking money that was shared in a group chat.
Setup
Registration on Razer Pay required a Malaysian or Singaporean mobile number. The researcher lived in Australia and did not own one, so friends and family in Malaysia helped source Malaysian numbers for testing. That registration barrier was part of the appeal: fewer hunters would get past it, so fewer duplicates.

Tools used across the work:
- Burp to proxy traffic from the app.
- apktool to decompile the APK.
- Jadx-Gui to read the decompiled code.
- IntelliJ IDEA to compile the extracted Java code and calculate signatures offline.
- Frida, run against a rooted device, to hook the signature method inside the running app.
Finding it
Proxying the app through Burp showed quickly that many parameters could not be tampered with, because of the signature field on each request. The first idea was to register a second account, copy a payload belonging to an action only that user could perform, and replay it in the first user's session. That failed: the signature was also calculated from the second user's session auth header, so a payload signed for one session did not validate in another.
To understand how signatures were built, the researcher decompiled the APK with apktool and read it in Jadx-Gui, searching for API endpoints and tracing them back to a method called MD5Encode. The name suggested MD5, but hashing the payload with MD5 never produced the right signature, perhaps because the parameters were in a different order or the implementation was not standard MD5.

Exploitation
Step 1: reproduce the signature offline
Rather than fight the obfuscation inside the app, the researcher copied all the Java code into IntelliJ IDEA and ran the signature calculation offline. Source analysis had already shown the order in which parameter values had to be passed into MD5Encode. Some minor tweaks were needed to get the code to compile because of the obfuscation, but not many. Feeding the same parameter values from an existing request into the method produced the same signature the app had sent, which confirmed the approach.


Step 2: delete another user's bank account
The hypothesis was that developers were relying on the signature to protect against parameter tampering, which would leave IDORs wherever the signature was the only check. The endpoint tested was /deleteBankAccount. The researcher calculated signatures for a range of predictable id values together with their corresponding signature values, then picked the id (bank Id) belonging to a second account he owned and delivered the payload.
The request succeeded and the second account's bank account was deleted.

Step 3: automate with Frida
Other endpoints were presumably vulnerable too, but repeating the offline compile did not work: they used different algorithms and were heavily obfuscated, the compilation failed, and troubleshooting obfuscated code was burning time. Frida avoided all of that. The only job left was to identify the right method to hook and supply the values it needed to compute a new signature.
The script below hooks MD5Encode in com.mol.molwallet.view.MD5. It first calls the method with a crafted string to produce a signature for the modified payload, then calls the method again with the original argument so the app keeps working.
// frida.js - Use this for recalculating signature for adding user to other people's chatgroup
console.log("Starting...")
Java.perform(function () {
var MD5 = Java.use('com.mol.molwallet.view.MD5')
MD5.MD5Encode.implementation = function (arg)
{
console.log("Hooking class MD5 - method MD5Encode")
//Extra step - calculate new signature
var ret_value = this.MD5Encode("groupId=1x9&userIds=95xxx7&[redacted]")
console.log("[+] signature= " + ret_value)
//Call method with original arguments so app doesn't crash ..
var ret_value = this.MD5Encode(arg) //original value
console.log("original ARG: " + arg)
return ret_value;
}
})
Root access was needed on the device. That did not reduce the severity, since the issue is server side and an attacker can use a rooted device. Frida server was started on the phone:
$ adb shell
# sudo su
# /data/local/tmp/frida-server
and the script was attached from another terminal:
$ frida -l frida.js -U com.mol.molwallet
With the hook in place, any action in the app that used MD5Encode printed a freshly calculated signature. Browsing the app and triggering the relevant action gave the signature needed to build a valid request. In the example above, the crafted string was for adding a user to a chat group, and the result was that the researcher could add himself to a chat group he had not been invited to. From there he could read other users' chat messages and take unclaimed money shared between members of the group.


Step 4: repeat across endpoints
The same Frida technique was applied to every other vulnerable API endpoint. High impact results included enumerating how much red packet money was shared between users or within a group, and viewing and modifying other users' transaction details and personal information.
Root cause
The design assumed that a valid signature proves the request came from the legitimate owner of the data. In practice the signature only proves that the payload was assembled by someone who can run the signing routine, and the signing routine ships inside the client. Once the algorithm and parameter order were recovered, any parameter value could be signed, including identifiers belonging to other users. The server accepted signed payloads referencing objects belonging to other users, which is what made the IDORs possible. The signature was also calculated from the session auth header, so a payload signed for one session did not validate in another.
Impact
An attacker with a rooted device and the ability to run the signing routine could, per the report:
- delete another user's bank account via
/deleteBankAccount; - add themselves to chat groups they were not invited to, read members' messages and take unclaimed money shared in the group;
- enumerate red packet amounts shared between users or in a group;
- view and modify other users' transaction details and personal information.
The total bounty for the reported issues was approximately $6,000. The researcher notes that disclosure and reward were at times frustrating because of slow responses, though most issues were resolved, and that he decided to take a break from the program.
Fix
The report does not describe the specific changes Razer made. The report does not describe the fix. A server-side ownership check on the identifier would address the IDORs. The signature can stay as an integrity and anti-tamper measure, but it must not be the only control.
Variants to test
- Signed mobile APIs. Proxy the app, note the signature field, decompile with apktool and Jadx-Gui, and look for the signing method. A positive result is reproducing a known request's signature offline or with a Frida hook.
- Cross-session replay. Take a signed payload from account A and send it with account B's session. If it fails, check whether the auth header is part of the signature, then sign your own payloads instead.
- Predictable identifiers. On endpoints such as delete, update or fetch by
id, sign a range of sequential or guessable identifiers. A positive result is a successful action on an object you do not own. - Group and sharing features. Try adding yourself to a group with a crafted
groupIdanduserIdspair, then check whether you can read messages or claim shared funds. - Obfuscated signing routines. When offline compilation fails, hook the method with Frida and feed it the modified values. A positive result is a printed signature that the server accepts.
What happened, in plain words
Razer Pay is a mobile wallet app: you install it on an Android phone, register with a phone number, and use it to hold and send money, similar to a digital purse. It was available in Singapore and Malaysia. The app and that computer exchange messages in a structured way, and those messages are what we call requests.
Every request the app sent to the server carried an extra field called signature. Think of it like a wax seal on an envelope: the sender melts wax over the flap so that if anyone opens the envelope and swaps the letter inside, the seal is broken and the recipient can tell. The signature is calculated from the request contents, so modifying parameters produced an error response. The purpose is to stop someone from intercepting the app's traffic and altering the parameters.

The researcher found a way around that seal. He worked out how the app calculates the signature, then calculated valid signatures himself for requests he had modified. With that ability he could change identifiers in requests, identifiers that say which bank account, which chat group or which user a request is about, and the server would happily act on someone else's data. This class of bug is called IDOR, short for Insecure Direct Object Reference: the server takes an identifier supplied by the client and uses it to look up a record, without checking that the person making the request is allowed to touch that record. A simple comparison: a hotel clerk who hands over any room key as long as you read out a room number, without checking that the room is booked in your name.
The issues he found included reading other users' chat messages, deleting another user's bank account, viewing private information, and taking money that had been shared in a group chat.
Background: why this app, and what tools were involved
When choosing which bug bounty program to work on, the researcher preferred programs with a higher barrier to entry, because fewer people get past the barrier and there is less chance that someone else reports the same bug first. A bug bounty program is a scheme where a company invites outside people to test its systems and pays for problems they report. When Razer joined the HackerOne platform, the Razer Pay app caught his eye precisely because registration required a Malaysian or Singaporean mobile number. He lived in Australia and did not own one. Friends and family in Malaysia helped him source Malaysian numbers for testing. He reasoned that many other hunters would be stopped by the same requirement, so he went deep into this app.

A few tools come up throughout, so here is what each one is, in everyday terms:
- Burp (Burp Suite): a program that sits between your phone or browser and the internet and lets you read and edit the traffic passing through. Like standing at a postbox, opening each letter, reading it, and putting it back, possibly with changes.
- APK: the file format of an Android app, the equivalent of an installer package. It contains the compiled program.
- apktool: a tool that unpacks an APK so you can look at its contents.
- Jadx-Gui: a tool with a windowed interface that turns the compiled Android program back into readable Java-like source code, so you can read what the app does.
- IntelliJ IDEA: a program for writing and running Java code. Here it was used to run pieces of the app's own code on a laptop, outside the phone.
- Frida: a tool that attaches to a running app and lets you intercept a chosen function, see the values going in and out, and even substitute your own result. Like putting a small tap on one pipe in a building so you can see and change what flows through it.
- Rooted device: an Android phone where the owner has removed the manufacturer's restrictions and gained full administrator control over the operating system. On a normal phone, apps are boxed in; on a rooted phone you can run tools that reach into other apps.
Finding it: the signature wall
The researcher began by proxying the app's traffic through Burp. Proxying means routing the app's internet connections through a tool so you can inspect them. He quickly noticed that many parameters could not be tampered with. A parameter is a named value in a request, for example id=123; tampering means changing that value before the request reaches the server. The reason tampering failed was the signature field present in each request.
His first idea was simple. He registered a second user account, captured a request that only that second user should be able to make, and tried to replay the same request inside the first user's session. A session is the server's memory of who you are while you are logged in; it is usually represented by a token or cookie, a long string the app sends with every request to prove which account it belongs to. The replay failed. The signature was also calculated from the second user's session authentication header, the part of the request that carries that proof of identity. A request signed for one session therefore did not validate in another. In envelope terms: the seal was not only over the letter, it was also tied to the sender's handwriting on the outside.
Determined to find how signatures were calculated, he decompiled the application with apktool and read it in Jadx-Gui. Decompiling means turning the packaged, compiled app back into something close to human-readable source code. He searched for API endpoints and traced them back to a method called MD5Encode. An API endpoint is a specific address on the server that performs a specific action, for example one address for deleting a bank account and another for sending a chat message. A method is a named block of code that does one job. MD5Encode is a method name, and MD5 is a well-known hashing algorithm: a recipe that takes any input and produces a fixed-length string of characters, called a hash, in a way that is easy to compute but very hard to reverse. The name suggested MD5, but hashing the payload with MD5 never produced the right signature. Perhaps the parameters were in a different order, or the implementation was not standard MD5.

Exploitation
Step 1: reproduce the signature offline
Rather than fight the obfuscation inside the app, he copied all the Java code into IntelliJ IDEA and ran the signature calculation offline, on his own computer. Obfuscation is a technique where developers rename methods and variables to meaningless short names and rearrange code so that it is hard for outsiders to read; it does not change what the program does, only how legible it is. His earlier source analysis had already shown the order in which parameter values had to be passed into MD5Encode. Some minor tweaks were needed to get the code to compile because of the obfuscation, but not many. Compiling means turning source code into a runnable program. Feeding the same parameter values from an existing request into the method produced the same signature the app had sent. That match confirmed the approach: he could now produce valid seals for any letter he wrote himself.


Step 2: delete another user's bank account
His hypothesis was that the developers were relying on the signature to protect against parameter tampering. If the signature was the only check, then any place where the server trusted an identifier from the request would be an IDOR. The endpoint he tested was /deleteBankAccount. He calculated signatures for a range of predictable id values together with their corresponding signature values. Predictable here means guessable, for example small numbers in sequence. He then picked the id (bank Id) belonging to a second account he owned and delivered the payload. A payload is the body of the request, the part that carries the actual data.
The request succeeded and the second account's bank account was deleted. He had proven that a valid signature let him act on an object belonging to a different account.

Step 3: automate with Frida
Other endpoints were presumably vulnerable too, but repeating the offline compile did not work. They used different algorithms and were heavily obfuscated, the compilation failed, and troubleshooting obfuscated code was burning time. Frida avoided all of that. The only job left was to identify the right method to hook and supply the values it needed to compute a new signature. Hooking means intercepting a function in a running program so that your own code runs whenever that function is called.
The script below hooks MD5Encode in com.mol.molwallet.view.MD5. It first calls the method with a crafted string to produce a signature for the modified payload, then calls the method again with the original argument so the app keeps working.
// frida.js - Use this for recalculating signature for adding user to other people's chatgroup
console.log("Starting...")
Java.perform(function () {
var MD5 = Java.use('com.mol.molwallet.view.MD5')
MD5.MD5Encode.implementation = function (arg)
{
console.log("Hooking class MD5 - method MD5Encode")
//Extra step - calculate new signature
var ret_value = this.MD5Encode("groupId=1x9&userIds=95xxx7&[redacted]")
console.log("[+] signature= " + ret_value)
//Call method with original arguments so app doesn't crash ..
var ret_value = this.MD5Encode(arg) //original value
console.log("original ARG: " + arg)
return ret_value;
}
})
Line by line, in plain words:
// frida.js - ...is a comment, a note for humans that the program ignores. It says this script recalculates a signature for adding a user to someone else's chat group.console.log("Starting...")prints the word Starting so you can see in the terminal that the script began running.Java.perform(function () {tells Frida to run the code inside the braces in the context of the app's Java runtime. Android apps are usually written in Java, so this is where the app's own code lives.var MD5 = Java.use('com.mol.molwallet.view.MD5')finds the app's class namedMD5in the packagecom.mol.molwallet.viewand stores a handle to it. A class is a bundle of related code; a package is a folder-like grouping of classes.MD5.MD5Encode.implementation = function (arg) {replaces the real implementation of theMD5Encodemethod with the function that follows. From now on, every time the app callsMD5Encode, this replacement runs instead.argis whatever value the app passed in.console.log("Hooking class MD5 - method MD5Encode")prints a note that the hook is active.var ret_value = this.MD5Encode("groupId=1x9&userIds=95xxx7&[redacted]")calls the original method with a string the researcher assembled himself. That string contains a group identifier, a user identifier and a token, joined with ampersands, the same way a web address carries several parameters. The result is a signature for that modified data.console.log("[+] signature= " + ret_value)prints that freshly calculated signature so the researcher can copy it into his own request.var ret_value = this.MD5Encode(arg) //original valuethen calls the method again with the value the app originally passed, so the app itself keeps behaving normally and does not crash.console.log("original ARG: " + arg)prints the original value for reference.return ret_value;hands the normal result back to the app.- The closing
})ends the function and theJava.performcall.
Root access was needed on the device. That did not reduce the severity, since the issue is server side and an attacker can use a rooted device. Frida server was started on the phone:
$ adb shell
# sudo su
# /data/local/tmp/frida-server
What these commands do:
$ adb shellopens a command shell on the connected Android phone using adb, the Android Debug Bridge, a standard tool for talking to a device from a computer. The$marks a normal command prompt.# sudo suswitches to the superuser account, the all-powerful administrator on the phone. The#marks a root prompt.# /data/local/tmp/frida-serverstarts the Frida server program that was placed in that folder on the phone. This is the piece that listens for instructions from the computer.
and the script was attached from another terminal:
$ frida -l frida.js -U com.mol.molwallet
fridaruns the Frida client on the computer.-l frida.jsloads the script file namedfrida.js.-Umeans use the USB-connected device.com.mol.molwalletis the app's package name, the unique identifier of the Razer Pay app on the phone.
With the hook in place, any action in the app that used MD5Encode printed a freshly calculated signature. Browsing the app and triggering the relevant action gave the signature needed to build a valid request. In the example above, the crafted string was for adding a user to a chat group, and the result was that the researcher could add himself to a chat group he had not been invited to. From there he could read other users' chat messages and take unclaimed money shared between members of the group.


Step 4: repeat across endpoints
The same Frida technique was applied to every other vulnerable API endpoint. High impact results included enumerating how much red packet money was shared between users or within a group, and viewing and modifying other users' transaction details and personal information. Enumerating means going through a list of identifiers one by one to see what comes back. A red packet is a traditional way of sharing money, common in parts of Asia, where a sum is split among people in a group.
Root cause
The design assumed that a valid signature proves the request came from the legitimate owner of the data. In practice the signature only proves that the payload was assembled by someone who can run the signing routine, and the signing routine ships inside the client. Once the algorithm and parameter order were recovered, any parameter value could be signed, including identifiers belonging to other users. The server accepted signed payloads referencing objects belonging to other users, which is what made the IDORs possible. The signature was also calculated from the session auth header, so a payload signed for one session did not validate in another.
In everyday terms: the wax seal proved the letter was sealed with the right stamp, but the stamp was handed out to everyone who bought the app. The seal said nothing about whether the sender was entitled to the room, the account or the group named inside.
Impact
An attacker with a rooted device and the ability to run the signing routine could, per the report:
- delete another user's bank account via
/deleteBankAccount; - add themselves to chat groups they were not invited to, read members' messages and take unclaimed money shared in the group;
- enumerate red packet amounts shared between users or in a group;
- view and modify other users' transaction details and personal information.
The total bounty for the reported issues was approximately $6,000. The researcher notes that disclosure and reward were at times frustrating because of slow responses, though most issues were resolved, and that he decided to take a break from the program.
Fix
The report does not describe the specific changes Razer made. The report does not describe the fix. A server-side ownership check on the identifier would address the IDORs. The signature can stay as an integrity and anti-tamper measure, but it must not be the only control. Back to the hotel: the clerk should check the booking record against your name, not just accept that the key request form was printed on official paper.
Variants to test
- Signed mobile APIs. Proxy the app, note the signature field, decompile with apktool and Jadx-Gui, and look for the signing method. A positive result is reproducing a known request's signature offline or with a Frida hook.
- Cross-session replay. Take a signed payload from account A and send it with account B's session. If it fails, check whether the auth header is part of the signature, then sign your own payloads instead.
- Predictable identifiers. On endpoints such as delete, update or fetch by
id, sign a range of sequential or guessable identifiers. A positive result is a successful action on an object you do not own. - Group and sharing features. Try adding yourself to a group with a crafted
groupIdanduserIdspair, then check whether you can read messages or claim shared funds. - Obfuscated signing routines. When offline compilation fails, hook the method with Frida and feed it the modified values. A positive result is a printed signature that the server accepts.
Glossary
- API: the set of addresses and rules a program uses to ask a server to do things, like a menu of actions a restaurant kitchen accepts.
- API endpoint: one specific address on the server that performs one specific action.
- APK: the file format of an Android app, containing the compiled program.
- apktool: a tool that unpacks an APK so its contents can be inspected.
- Authentication header: the part of a request that carries proof of which account is making it, usually a token.
- Bug bounty program: a scheme where a company pays outside researchers for reporting security problems.
- Burp (Burp Suite): a tool that sits between an app and the internet so you can read and edit the traffic.
- Class: a bundle of related code in a Java program.
- Compile: turn source code into a runnable program.
- Cookie: a small piece of data a server asks a client to send back with later requests, often used to remember a session.
- Decompile: turn a packaged, compiled app back into something close to readable source code.
- Enumeration: going through a list of identifiers one by one to see what each returns.
- Frida: a tool that attaches to a running app and lets you intercept and alter the behaviour of chosen functions.
- Hash / MD5: a recipe that turns any input into a fixed-length string, easy to compute and hard to reverse; MD5 is one such recipe.
- Hook: intercept a function in a running program so your own code runs when it is called.
- IDOR (Insecure Direct Object Reference): a bug where the server uses an identifier supplied by the client to fetch or change a record without checking that the client is allowed to touch it.
- Jadx-Gui: a tool with a graphical interface that turns compiled Android code back into readable source.
- Method: a named block of code that performs one job.
- Obfuscation: renaming and rearranging code so it is hard for outsiders to read, without changing what it does.
- Package: a folder-like grouping of code classes.
- Parameter: a named value in a request, such as
id=123. - Payload: the body of a request, the part carrying the actual data.
- Proxy: route traffic through an intermediate tool so it can be inspected or modified.
- Red packet: a traditional way of sharing a sum of money among people, common in parts of Asia.
- Request: a message an app sends to a server asking it to do something.
- Rooted device: an Android phone where the owner has gained full administrator control over the operating system.
- Session: the server's memory of who you are while logged in, usually represented by a token or cookie.
- Signature: a value calculated from a request's contents and sent with it, so the server can detect if anything was changed.
- Tampering: changing values in a request before it reaches the server.
- Token: a long string sent with requests to prove which session or account they belong to.