Skip to content
Business logic Write-up Intermediate

What if you could deposit money into your Betting account for free? Oh wait where has this 25k came from…

The payment provider Skrill used a weak secret word (max 10 lowercase alphanumeric characters) to generate an MD5 signature for transaction validation, and the status URL could be manipulated to capture valid transaction data. An attacker could brute-force the secret word, forge a valid signature, and send a fake transaction to the target's IPN endpoint, crediting their betting account with 25,000 GBP for free.

Mikey Follow

Published on mikey96.medium.com

Bounty$10,000 View original

I have always been interested in payment systems since I had to implement my very first PayPal IPN around about 4 years ago. IPN’s are generally how the payments are communicated and processed between the payment company and vendor site.

Mikey, on mikey96.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Payment integrations between a vendor site and a payment provider are usually driven by an IPN (Instant Payment Notification): the provider sends a callback to the vendor with the details of a transaction, and the vendor decides whether to credit the account. The author had first met this flow while implementing a PayPal IPN, and the general shape of it is shown below.

General overview of the IPN process. From the original on mikey96.medium.com

General overview of the IPN process.

The research described here started from a much simpler bug found with a friend (@SecureFocus on Twitter) in a small number of online games. Those games did not store the unique PayPal transaction ID in their database, so a captured IPN request could be relayed to the server an unlimited number of times and the in-game rewards collected repeatedly. The only manipulation needed was changing the statusUrl parameter to a server the attacker controlled. That basic relay attack became the foundation for the work described here, which ended in critical bounties from two of the biggest online gambling companies in the UK.

Setup

The work required an account on each target betting platform, the ability to start a deposit, Burp Suite to intercept and edit the outgoing request, and a server the author controlled. The key precondition was that the target used Skrill (then a UK based payment provider) and that the default configuration of the payment integration submitted the transaction data to the provider through an HTML form using a GET or POST request. The author also wrote a custom tool in Java to brute force the provider's secret word, and used a 50GB wordlist with it.

Finding it

The central concept is the relay attack. The author set out to find other payment systems where the statusUrl address could be pointed at a server they owned. It turned out to be common for default configurations to build the transaction with an HTML form submitted to the payment provider, so capturing that request in Burp Suite and editing statusUrl was enough to generate a valid transaction whose status callback would be delivered to the attacker's server instead of the target's.

Showing how to manipulate the status URL so you can receive the response from payment provider in this one Skrill. From the original on mikey96.medium.com

Showing how to manipulate the status URL so you can receive the response from payment provider in this one Skrill.

With the callback captured, the next question was which payment system had a weak protocol for verifying that a transaction is legitimate. The author settled on Skrill, and describes the weakness as immediately obvious from the API documentation. At the time, validation relied on six factors combined into an MD5 signature: merchant_id, transaction_id, secret_word, mb_amount, mb_currency and status_code, plus a secret word.

Parameters all involved in generating the MD5 signature that make up a valid transaction. From the original on mikey96.medium.com

Parameters all involved in generating the MD5 signature that make up a valid transaction.

The parameters are combined into the signature in simplified terms as:

Text
MD5(merchant_id + transaction_id + MD5(secret_word).toUppercase() + mb_amount + mb_currency + status)
How Skrill generates the MD5 signature. From the original on mikey96.medium.com

How Skrill generates the MD5 signature.

Skrill computes this signature first and sends it alongside the other payment data so the target server can validate it. The data sent to the target, as intercepted by the author, looked like this:

Data sent from Skrill for their clients to verify the transaction as legitimate. From the original on mikey96.medium.com

Data sent from Skrill for their clients to verify the transaction as legitimate.

That is the full set of information available once statusUrl has been redirected. Relaying it back to the target confirms the capture is correct, because the transaction processes normally. The important observation is that every parameter used to build the MD5 signature is sent back in the response, so the target can recompute a signature and compare it with the one received. Matching signatures are what ultimately confirm the transaction as legitimate.

The real weakness is the secret word itself. It was limited to no more than 10 characters, all lowercase, digits 0 to 9, and no symbols. That makes brute forcing it a realistic proposition.

The terrible limitations to a secret word that controls the full validation process… From the original on mikey96.medium.com

The terrible limitations to a secret word that controls the full validation process…

Targets generally process the data that Skrill, or an attacker, sends to them in the way shown below. The MD5 signatures have to match before anything is done with the data, and therefore with the transaction.

Code to show the general implementation of validating transactions via Skrill from request data. From the original on mikey96.medium.com

Code to show the general implementation of validating transactions via Skrill from request data.

Exploitation

Step 1: Redirect the status callback and capture a real transaction

Intercept the deposit request in Burp Suite and change the statusUrl parameter to a server under your control. The provider then generates a valid transaction and sends its notification to you rather than to the target, giving you the full set of payment data shown above, including the MD5 signature.

Step 2: Brute force the secret word

The author wrote a Java tool that hashes in exactly the same way as the provider. It is supplied with the static parameters from a valid transaction that was relayed, and iterates through a 50GB wordlist, hashing each candidate in this format until it matches the intercepted signature:

Text
MD5(merchant_id + transaction_id + MD5([WORD-HERE]).toUppercase() + mb_amount + mb_currency + status)

Run against two of the UK's biggest gambling chains, both secret words were cracked in less than 24 hours.

Step 3: Create a transaction and sign it yourself

With the secret word known, a valid transaction can be manufactured. Fill in the deposit form for the amount wanted, 25,000GBP in this case, and intercept the request. It contains every parameter needed to generate a valid MD5 signature: transaction_id, merchant_id, mb_amount, mb_currency and status. Generate the signature in the same manner as above, using the cracked secret word.

How I generated the “fake” MD5 signature. From the original on mikey96.medium.com

How I generated the “fake” MD5 signature.

Step 4: Send the forged notification to the IPN processor

Send the POST request to the target's IPN processor. The author's cURL request looked something like this:

with the transaction data formatted as in the image below, the parameters replaced with genuine values from the transactions started on the platforms.

Format of the transaction data I sent to the targets, with the parameters replaced with genuine parameters for the transactions I had started on the platforms. From the original on mikey96.medium.com

Format of the transaction data I sent to the targets, with the parameters replaced with genuine parameters for the transactions I had started on the platforms.

After sending the request, the betting account balance showed 25,000GBP.

Root cause

The design flaw is that the transaction is generated from a request the client can influence, specifically the statusUrl parameter, so the attacker can receive the provider's genuine notification and replay or forge it. The only thing standing between the attacker and a credited balance is the MD5 signature, and that signature is keyed by a secret word with a very small search space: at most 10 characters, lowercase letters and digits only, no symbols. The signature algorithm itself is not the problem; the entropy of the key is. Because every parameter needed to recompute the signature is sent back in the notification, an attacker who captures one genuine transaction has everything required to test candidate secret words offline, and once the secret word is known any transaction can be signed.

Impact

An attacker with an account on a betting platform using this integration could credit their own balance with an arbitrary deposit amount, in this case 25,000GBP, without paying. The author was told by the AppSec teams that there was no way this could be detected as a fraudulent transaction. The attack worked against two of the UK's biggest gambling companies, and the author notes that the same technique would apply to any target using the same provider configuration. The author does not name the companies.

Fix

The author advised the following remediation steps:

  1. Generate the transaction internally so an attacker cannot manipulate the statusUrl parameter.
  2. Validate that requests come from the Skrill servers before processing them.
  3. Use better passwords for the secret word.

The AppSec teams acted promptly and fixed the issues almost immediately. The author was rewarded roughly 10,000 USD in total across the two companies.

Variants to test

  • Look for payment integrations where the transaction is created from a client-side form and the callback URL (statusUrl or equivalent) is a request parameter. A positive result is a genuine provider notification arriving at a server you control.
  • Check whether the provider's signature key has a restricted character set or short length. A positive result is recovering the key from a single captured notification within a feasible wordlist run.
  • Check whether the vendor stores the provider's unique transaction ID. If it does not, a captured notification can be replayed repeatedly, as in the original online games case.
  • Check whether the vendor verifies the source of the callback, for example by confirming it comes from the provider's servers. A positive result is a forged notification from your own host being accepted.
  • Check whether the vendor recomputes the signature over all fields and rejects mismatches. A positive result is a notification with a signature you generated being credited.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

A researcher found a way to put money into his own betting account without paying for it. He did this on two of the biggest online gambling companies in the UK, and the balance he created was 25,000GBP. He was paid roughly 10,000 USD in total across the two companies for reporting it.

The trick relies on how a betting site and a payment company talk to each other. When you pay a site through a payment provider, the provider does not just take your money and stay quiet. It sends a message back to the site saying "this person paid, please credit their account". That message is called an IPN, short for Instant Payment Notification. The site trusts that message, checks it, and then adds the money to your balance.

The researcher found that he could point the statusUrl at a server he controlled, so the provider sent its message to him instead of the betting site. That gave him a real, genuine payment message to study. He then worked out the password the betting site used to check that messages are real, and with that password he could write his own fake message saying "this person paid 25,000GBP". The betting site accepted it and credited the balance.

This article walks through the whole thing from the beginning, assuming you have never looked at a web request in your life. Every term is explained where it first appears, and there is a glossary at the end.

The starting point: how online payments talk back to a shop

The researcher had become interested in payment systems a few years earlier, when he had to build his very first PayPal IPN. An IPN is the message a payment company sends to the website that sold you something, to tell it that a payment has happened. The general flow looks like this:

General overview of the IPN process. From the original on mikey96.medium.com

General overview of the IPN process.

Think of it like a restaurant. You pay the cashier (the payment provider). The cashier then shouts through to the kitchen (the shop's server) "order paid, start cooking". The kitchen does not see your card or your cash; it only trusts the shout from the cashier. If someone could fake that shout, the kitchen would cook for free.

Before this research, the author and a friend (@SecureFocus on Twitter) had found a much simpler bug in a small number of online games. Those games accepted the payment message but never wrote down the unique transaction ID that PayPal gives to each payment. A transaction ID is a long code that identifies one specific payment, a bit like a receipt number. Because the games did not store it, the same message could be sent to the server again and again, and each time the game would hand out the in-game rewards. The only change needed was to point the statusUrl parameter at a server the attacker controlled. statusUrl is simply a web address that the payment provider is told to send its message to; changing it is like writing a different return address on an envelope.

That simple replay trick was the seed for everything that follows. It eventually led to critical bounties from two of the biggest online gambling companies in the UK. A bounty is a reward a company pays to someone who reports a security problem to them responsibly.

What was needed to try it

The setup was small. The researcher needed:

  1. An account on each target betting platform.
  2. The ability to start a deposit, so that a real payment message would be generated.
  3. A tool called Burp Suite, which sits between your browser and the website and lets you pause, read and edit the requests your browser sends.
  4. A server he controlled, to receive the redirected payment message.
  5. A custom tool written in Java to guess the provider's secret word, run against a 50GB wordlist (a huge file of candidate passwords).

The important precondition was that the target used Skrill, a payment provider then based in the UK, and that the default way the site set up the payment sent the transaction data to Skrill through an HTML form using a GET or POST request. An HTML form is the set of boxes and a submit button you fill in on a web page. GET and POST are the two common ways a browser sends that form's contents to a server: GET puts the values in the address bar, POST puts them in the body of the request. Either way, the browser is the one sending them, which means the person using the browser can change them.

Finding the weakness

The central idea is the relay attack. A relay is exactly what it sounds like in sport: you catch the ball and pass it on to someone else. Here, the researcher catches the payment provider's message and passes it somewhere else, namely to himself.

He set out to find other payment systems where the statusUrl address could be pointed at a server he owned. He found that it is pretty common for default configurations to build the transaction with an HTML form submitted to the payment provider. So all he had to do was capture that request in Burp Suite and edit statusUrl. The provider would then generate a valid transaction and send its status message to the researcher's server instead of the target's.

Showing how to manipulate the status URL so you can receive the response from payment provider in this one Skrill. From the original on mikey96.medium.com

Showing how to manipulate the status URL so you can receive the response from payment provider in this one Skrill.

With a genuine message captured, the next question was which payment system had a weak way of proving that a message is legitimate. He settled on Skrill, and describes the weakness as immediately obvious from the API documentation. An API is the set of rules and addresses a service publishes so that other software can talk to it; the documentation is the manual for those rules.

At the time, Skrill's validation relied on six factors combined into an MD5 signature: merchant_id, transaction_id, secret_word, mb_amount, mb_currency and status_code, plus a secret word. Let us unpack those:

  • merchant_id: the shop's identifier at Skrill, a number that says which business this payment belongs to.
  • transaction_id: the unique code for this one payment.
  • secret_word: a password shared between Skrill and the shop, used to prove the message really came from Skrill.
  • mb_amount: the amount of money involved. "mb" is short for Moneybookers, Skrill's earlier name.
  • mb_currency: which currency the amount is in.
  • status_code: what happened to the payment, for example whether it succeeded.
Parameters all involved in generating the MD5 signature that make up a valid transaction. From the original on mikey96.medium.com

Parameters all involved in generating the MD5 signature that make up a valid transaction.

An MD5 signature here is a fingerprint. You feed a piece of text into a mathematical function called MD5, and it produces a fixed-length string of characters. The same input always gives the same output, but changing even one character gives a completely different output, and you cannot work backwards from the output to the input. It is like a blender: put in the same fruit, get the same smoothie; you cannot unblend it.

The parameters are combined into the signature, in simplified terms, like this:

Text
MD5(merchant_id + transaction_id + MD5(secret_word).toUppercase() + mb_amount + mb_currency + status)

Line by line, in plain words:

  • MD5( opens the fingerprint calculation. Everything inside the brackets is the input.
  • merchant_id + transaction_id + glues the shop identifier and the payment identifier together as text.
  • MD5(secret_word).toUppercase() takes the secret password, fingerprints it once, then converts the result to uppercase letters. This is a fingerprint of a fingerprint, which is a common way to mix a password into a signature.
  • + mb_amount + mb_currency + status glues on the amount, the currency and the payment status.
  • The closing ) means the whole glued-together string is fingerprinted once more, and that final fingerprint is the signature.
How Skrill generates the MD5 signature. From the original on mikey96.medium.com

How Skrill generates the MD5 signature.

Skrill computes this signature first and sends it alongside the other payment data, so the target server can check it. The data sent to the target, as the researcher intercepted it, looked like this:

Data sent from Skrill for their clients to verify the transaction as legitimate. From the original on mikey96.medium.com

Data sent from Skrill for their clients to verify the transaction as legitimate.

That is the full set of information you get once statusUrl has been redirected. Relaying it back to the target confirms the capture is correct, because the transaction processes normally. The key observation is that every parameter used to build the MD5 signature is sent back in the message, so the target can recompute a signature and compare it with the one it received. If the two match, the transaction is treated as legitimate.

Think of it like a shop that receives a parcel with a wax seal. The shop has a stamp of its own and re-stamps the same contents; if the two seals match, it accepts the parcel. The problem is that the shop also tells you exactly what contents it stamped, so you can practise stamping at home until you get it right.

The real weakness is the secret word itself. It was limited to no more than 10 characters, all lowercase, digits 0 to 9, and no symbols. That makes guessing it a realistic proposition. A password like that has a small number of possible combinations compared with a long password full of mixed characters.

The terrible limitations to a secret word that controls the full validation process… From the original on mikey96.medium.com

The terrible limitations to a secret word that controls the full validation process…

Targets generally process the data that Skrill, or an attacker, sends to them in the way shown below. The MD5 signatures have to match before anything is done with the data, and therefore with the transaction.

Code to show the general implementation of validating transactions via Skrill from request data. From the original on mikey96.medium.com

Code to show the general implementation of validating transactions via Skrill from request data.

Carrying out the attack

Step 1: Redirect the status callback and capture a real transaction

Intercept the deposit request in Burp Suite and change the statusUrl parameter to a server under your control. The provider then generates a valid transaction and sends its notification to you rather than to the target, giving you the full set of payment data shown above, including the MD5 signature.

Why this step matters: without a genuine message you have nothing to compare against. You need one real example of the provider's output, including its signature, so that later you can check whether a guessed password produces the same signature.

Step 2: Brute force the secret word

The researcher wrote a Java tool that hashes in exactly the same way as the provider. It is supplied with the fixed parameters from a valid transaction that was relayed, and it iterates through a 50GB wordlist, hashing each candidate in this format until it matches the intercepted signature:

Text
MD5(merchant_id + transaction_id + MD5([WORD-HERE]).toUppercase() + mb_amount + mb_currency + status)

Line by line, in plain words:

  • MD5( opens the fingerprint calculation, exactly as the provider does it.
  • merchant_id + transaction_id + are the fixed values from the real transaction you captured. They do not change during the guessing.
  • MD5([WORD-HERE]).toUppercase() is the only part that changes. For each candidate password from the wordlist, the tool fingerprints it and uppercases the result, just like the provider.
  • + mb_amount + mb_currency + status are the remaining fixed values from the captured transaction.
  • The closing ) produces a candidate signature, which the tool compares with the real one. If they match, the candidate word is the secret.

Brute forcing means trying every possibility until one works. A wordlist is a long list of likely passwords, and 50GB of them is an enormous list. Run against two of the UK's biggest gambling chains, both secret words were cracked in less than 24 hours.

Step 3: Create a transaction and sign it yourself

With the secret word known, a valid transaction can be manufactured. Fill in the deposit form for the amount you want, 25,000GBP in this case, and intercept the request. It contains every parameter needed to generate a valid MD5 signature: transaction_id, merchant_id, mb_amount, mb_currency and status. Generate the signature in the same manner as above, using the cracked secret word.

Why this works: the site checks that the signature matches the data, and with the secret word you can produce a matching signature. If you know the password used to make the signature, you can sign anything.

How I generated the “fake” MD5 signature. From the original on mikey96.medium.com

How I generated the “fake” MD5 signature.

Step 4: Send the forged notification to the IPN processor

Send the POST request to the target's IPN processor. The researcher's cURL request looked something like this:

Line by line, in plain words:

  • curl is a command-line tool for sending web requests. It is the same kind of request your browser sends, just typed out instead of clicked.
  • https://target.com/moneybookers.aspx is the address of the page on the betting site that handles payment notifications. The name refers to Moneybookers, Skrill's earlier name.
  • — data “[TRANSACTION DATA HERE]” is where the payment data goes. In the real attack this placeholder was replaced with the actual fields of the transaction, formatted as in the image below.

The transaction data was formatted as in the image below, with the parameters replaced with genuine values from the transactions started on the platforms.

Format of the transaction data I sent to the targets, with the parameters replaced with genuine parameters for the transactions I had started on the platforms. From the original on mikey96.medium.com

Format of the transaction data I sent to the targets, with the parameters replaced with genuine parameters for the transactions I had started on the platforms.

After sending the request, the betting account balance showed 25,000GBP.

Why it worked

The design flaw is that the transaction is generated from a request the client can influence, specifically the statusUrl parameter. That lets the attacker receive the provider's genuine notification and then replay or forge it. The only thing standing between the attacker and a credited balance is the MD5 signature, and that signature is keyed by a secret word with a very small search space: at most 10 characters, lowercase letters and digits only, no symbols. The signature algorithm itself is not the problem; the strength of the key is. Because every parameter needed to recompute the signature is sent back in the notification, an attacker who captures one genuine transaction has everything required to test candidate secret words offline, and once the secret word is known any transaction can be signed.

What it meant for the companies

An attacker with an account on a betting platform using this integration could credit their own balance with an arbitrary deposit amount, in this case 25,000GBP, without paying. The researcher was told by the AppSec teams (the security teams responsible for the companies' applications) that there was no way this could be detected as a fraudulent transaction. The attack worked against two of the UK's biggest gambling companies, and the researcher notes that the same technique would apply to any target using the same provider configuration. He does not name the companies.

How it was fixed

The researcher advised the following remediation steps:

  1. Generate the transaction internally so an attacker cannot manipulate the statusUrl parameter.
  2. Validate that requests come from the Skrill servers before processing them.
  3. Use better passwords for the secret word.

The AppSec teams acted promptly and fixed the issues almost immediately. The researcher was rewarded roughly 10,000 USD in total across the two companies.

Things worth checking on other sites

  • Look for payment integrations where the transaction is created from a client-side form and the callback URL (statusUrl or equivalent) is a request parameter. A positive result is a genuine provider notification arriving at a server you control.
  • Check whether the provider's signature key has a restricted character set or short length. A positive result is recovering the key from a single captured notification within a feasible wordlist run.
  • Check whether the shop stores the provider's unique transaction ID. If it does not, a captured notification can be replayed repeatedly, as in the original online games case.
  • Check whether the shop verifies the source of the callback, for example by confirming it comes from the provider's servers. A positive result is a forged notification from your own host being accepted.
  • Check whether the shop recomputes the signature over all fields and rejects mismatches. A positive result is a notification with a signature you generated being credited.

Glossary

  • API: the published set of rules and addresses that let one piece of software talk to another; the documentation is its manual.
  • AppSec team: the group inside a company responsible for the security of its applications.
  • Bounty: a reward a company pays to someone who reports a security problem to it responsibly.
  • Brute force: trying every possible value until one works, usually with a computer doing millions of attempts per second.
  • Burp Suite: a tool that sits between your browser and a website so you can pause, read and edit the requests being sent.
  • Callback: a message one system sends back to another to report that something happened.
  • cURL: a command-line tool for sending web requests by typing them out.
  • GET / POST: the two common ways a browser sends form data to a server; GET puts values in the address, POST puts them in the request body.
  • HTML form: the boxes and submit button on a web page that collect information and send it to a server.
  • IPN (Instant Payment Notification): the message a payment provider sends to a shop to say a payment has happened.
  • MD5: a mathematical function that turns any text into a fixed-length fingerprint; the same input always gives the same output, and you cannot reverse it.
  • Merchant ID: the identifier a shop is given by a payment provider.
  • Moneybookers: Skrill's earlier name, which is why the fields are prefixed mb_.
  • Parameter: a named value sent with a web request, such as statusUrl or mb_amount.
  • Relay attack: catching a message meant for someone else and passing it on somewhere you choose.
  • Replay attack: sending the same valid message again and again to get the same effect repeatedly.
  • Secret word: a password shared between a payment provider and a shop, used to prove a message is genuine.
  • Signature: a fingerprint computed over a message plus a secret, used to prove the message has not been changed and came from someone who knows the secret.
  • Skrill: a payment provider, then based in the UK.
  • statusUrl: the web address a payment provider is told to send its notification to.
  • Transaction ID: the unique code identifying one specific payment.
  • Wordlist: a large file of candidate passwords used for guessing.

More by Mikey

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.