Schain owners can rug pull users’ funds
The deposit box contracts allow a chain owner to call getFunds after a chain is killed, transferring all deposited funds to any receiver. This gives the owner a rug-pull vector, though it requires cooperation from the IMA mainnet admin.
Submitted by IllIllI, also found by gzeon and kirk-baird
Impact
Once a chain has been killed the chain owner is able to call getFunds() on each of the deposit boxes and transfer funds/tokens wherever he/she wishes
Even if the owner is benevolent the fact that there is a rug vector available may negatively impact the protocol’s reputation. See this example where a similar finding has been flagged as a high-severity issue. I’ve downgraded these instances to be a medium since it requires cooperation of the IMA mainnet admin.
Proof of Concept
function getFunds(string calldata schainName, address payable receiver, uint amount)
external
override
onlySchainOwner(schainName)
whenKilled(keccak256(abi.encodePacked(schainName)))
function getFunds(string calldata schainName, address erc20OnMainnet, address receiver, uint amount)
external
override
onlySchainOwner(schainName)
whenKilled(keccak256(abi.encodePacked(schainName)))
function getFunds(string calldata schainName, address erc721OnMainnet, address receiver, uint tokenId)
external
override
onlySchainOwner(schainName)
whenKilled(keccak256(abi.encodePacked(schainName)))
function getFunds(
string calldata schainName,
address erc1155OnMainnet,
address receiver,
uint256[] memory ids,
uint256[] memory amounts
)
external
override
onlySchainOwner(schainName)
whenKilled(keccak256(abi.encodePacked(schainName)))
Recommended Mitigation Steps
Add a long time lock for killing so users have plenty of time to get their funds out before a kill
DimaStebaev (SKALE) disputed and commented:
Acknowledged, and timelock & eventual removal has been added to the roadmap This is not a vulnerability. We explicitly added this functionality to prevent loosing of funds in case of technical problems with SKALE chain. It requires SKALE chain owner and SKALE foundation cooperation to run this mechanism. It is going to be removed eventually after some time of stable work.
GalloDaSballo (judge) commented:
While I empathize with the sponsor’s side that the function is meant as a security mechanism, it does allow the chainOwner to pull all funds and transfer them to their own wallet.
Because this is contingent on Admin Privilege, I believe Medium Severity to be appropriate
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The getFunds function is restricted only to the chain owner and the killed state, with no time lock or user withdrawal window, so the owner can redirect all deposited assets.
Impact
A chain owner could transfer all funds held in the deposit boxes to themselves, but this requires cooperation of the IMA mainnet admin and was downgraded to medium severity.
What the attacker needed
Chain owner role; chain must be killed; IMA mainnet admin cooperation
The fix
Add a long time lock for killing so users have plenty of time to get their funds out before a kill.
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 report has not been written yet. The Original tab links to the source.
A deposit box is a smart contract that holds users' cryptocurrency while they use a side chain. The owner of that side chain can mark it as 'killed' and then withdraw all the money in the deposit box to any address they choose. This means users could lose their funds if the owner acts maliciously, although the report notes that an admin must also cooperate.
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.