SettlementConfiguartion.update()
does not enforce any validation for keeper
address. This means that the owner
is at liberty to set this field to address(0)
.
However, when this is done, anyone will be able to call fillOffchainOrders()
and fillMarketOrder()
NOTE: Let it be noted that this report is not about
adress sanitization against address(0)
which was already reported as alow severity
finding by theLightChaser bot
. This report is aboutaccess control violation
as described here below.
fillOffchainOrders()
and fillMarketOrder()
are protected by onlyOffchainOrdersKeeper
and onlyMarketOrderKeeper
modifiers. Within the implementation, _requireIsKeeper()
is called internally which ensures that the sender
is the configured keeper
address.
As seen, the fucntion performs two checks for this.
check if sender
is not keeper
check if keeper
is not address(0)
As such, the function will only revert if both the conditions are true
. i.e if the caller is not keeper
and the keeper
address is not set to address(0)
However, if for any reason, the owner
sets the keeper
address to address(0)
, issues may arise.
When this is done, Bob
calls fillOffchainOrders()
or fillMarketOrder()
and this is how the check will look like:
Is sender != keeper
? ---> This will be true
beacuse Bob
's address is not address(0)
Is keeper != address(0)
? ---> This will be false
because keeper
has been set to address(0)
As seen, the whole logic will therefore evaluate false
meaning that the revert
will not be executed.
Acces control breach.
fillOffchainOrders()
and fillMarketOrder()
will be callable by anyone when the owner
sets the keeper
to address(0)
.
Manual Review
Modifiy the check in _requireIsKeeper()
as follows:
This way, whether the keeper
is set to address(0)
or any other address, the check will always work accurately.
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.