Retrospective: Recent Coinbase Bug Bounty Award
A missing validation check in a Coinbase trading API allowed a user to submit a trade using a mismatched source account, potentially selling assets they did not own. An attacker could have placed orders on the exchange without sufficient funds in the correct account.
blog.coinbase.com
Published on blog.coinbase.com
At Coinbase, our number one priority is ensuring that we uphold our security commitments to our customers. On February 11, 2022, we received a report from a third-party researcher indicating that they had uncovered a flaw in Coinbase’s trading interface.
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 API endpoint failed to verify that the source account's asset matched the asset being traded, only checking the balance.
Impact
The flaw could have allowed a user to place trades without holding the necessary assets, but automatic price protection circuit breakers and trade surveillance would have limited the impact if exploited at scale.
What the attacker needed
A Coinbase account with multiple sub-accounts; access to the Retail Advanced Trading API; ability to modify API requests
The fix
The bug was fixed by adding a validation check to ensure the source account matches the asset being traded.
How it was found
- A user has an account with 100 SHIB and a second account with 0 BTC.
- The user submits a market order to sell 100 BTC on the BTC-USD order book.
- The user manually edits the API request to specify the SHIB account as the source of funds.
- The validation service checks the SHIB account balance but not the asset match.
- The order to sell 100 BTC is entered on the Coinbase Exchange.
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.
This bug was in a system that lets people buy and sell cryptocurrency. The system checked if you had enough money in your account, but it did not check if that account actually held the cryptocurrency you were trying to sell. So someone could pretend to sell Bitcoin they did not have, which could mess up the market.
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.