OrderBook

First Flight #43
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: high
Likelihood: low
Invalid

Centralization Risk in the Protocol. Owner can steal all funds

A malicious owner of the protocol can steal all funds that are currently present in the contract

Description

OrderBook::emergencyWithdrawERC20 can only be called by the owner of the protocol in emergency situations, however a malicious owner can call this function to send him all the tokens present in the contract

function emergencyWithdrawERC20(
address _tokenAddress,
uint256 _amount,
address _to
@> ) external onlyOwner {
if (
_tokenAddress == address(iWETH) ||
_tokenAddress == address(iWBTC) ||
_tokenAddress == address(iWSOL) ||
_tokenAddress == address(iUSDC)
) {
revert(
"Cannot withdraw core order book tokens via emergency function"
);
}
if (_to == address(0)) {
revert InvalidAddress();
}
IERC20 token = IERC20(_tokenAddress);
token.safeTransfer(_to, _amount);
emit EmergencyWithdrawal(_tokenAddress, _amount, _to);
}

Risk

Likelihood:
This vulnerability can occur in case of a malicious owner

Impact:

Loss of funds for the sellers that submitted their Orders

Recommended Mitigation

Consider using a multiSig wallet or implement a DAO Governance that will decide when to call this function

Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.