OrderBook::setAllowedSellToken
function could permit non-ERC20 tokens leading to complete DOS for affected token operation.If an owner maliciously or accidentally sets a non-ERC20
contract address as allowed token, users may attempt to create sell orders with this token and the IERC20::safeTransferFrom
call in OrderBook::createSellOrder
will always fail because the address doesn't implement ERC20 interface.
No conditional check added to ensure the erc20 compatibility of new token addresses.
Likelihood:
When an owner maliciously or accidentally sets a non-ERC20
contract address as allowed token.
Impact:
This can create a permanent denial-of-service (DOS) attack where users lose gas and cannot create orders with that token.
This shows a random address being successfully set as token address.
Validating ERC20 compliance before modifying the storage variable
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.