onlyAllowlisted
modifier is checking msg.sender
as sender. but, the actual sender is abi.decode(any2EvmMessage.sender, (address))
. so, it can be bypassed by sending the transaction from the allowlisted address.
_ccipReceive
function have onlyAllowlisted
modifier with wrong sender address. The actual sender is abi.decode(any2EvmMessage.sender, (address))
but the modifier is checking msg.sender
.
here is the poc to bypass the onlyAllowlisted
modifier.
abi.decode(any2EvmMessage.sender, (address)) is actual sender.
msg.sender is not sender
if msg.sender is allowlistedSenders then it will bypass the check all the time because msg.sender is not change in every tranction but the actual sender(i.e abi.decode(any2EvmMessage.sender, (address))) is change in every transaction if it done by different address.
this bypass the check for allowlistedSenders[_sender] is true or not because the sender is not the msg.sender. but, the actual sender is abi.decode(any2EvmMessage.sender, (address)).
Manual review
Here is the updated code
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.