Xdai Stake Arbitrary Call Method Bug Fix Review
The xDai Arbitrary Message Bridge contracts allowed calls to any method of any contract, so an attacker could compose a message that executed a token transfer on behalf of the bridge contracts. This could steal tokens that users had mistakenly sent to those contracts, though the contracts were not intended to hold funds.
immunefi.com
Published on immunefi.com
On August 1, whitehat 0xadee028d submitted an arbitrary method call vulnerability in xDai to Immunefi. The vulnerability was assessed to have a severity level of medium, but was out of scope of xDai’s bug bounty program.
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 bridge contracts allowed arbitrary method calls without restricting which contracts or methods could be invoked, so they could be used to transfer tokens they held.
Impact
An attacker could steal any tokens accidentally sent to the AMB contracts; at the time only $4.50 in renBTC was at risk, and the OmniBridge contracts that are meant to hold funds were not affected.
What the attacker needed
Tokens mistakenly sent to AMB contract; attacker can submit bridge messages
The fix
xDai planned to add a monitor on the AMB contract to watch for Transfer events so locked tokens could be identified before someone else accessed them.
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.
A bridge lets you move messages and tokens between two blockchains. The bridge's own contracts could be told to call any function on any contract, including a token transfer, so if someone accidentally sent tokens to the bridge contract, an attacker could make the bridge send those tokens to themselves.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.