The _consumeMessageAutoWithdraw function does not work properly
The _consumeMessageAutoWithdraw is intended to execute messages that have been checked by the owner and set them as consumed once used to prevent replay attack. The function works like this:
As we can see, the default state of a message is the 0x00 (WITHDRAW_AUTO_NONE). If a message is eligible to be auto withdrawed, the contract owner will call the addMessageHashForAutoWithdraw which ensures that the message state is the default (NONE) and changes it to the READY state. Only once a message is in the READY state, can be consumed by calling the _consumeMessageAutoWithdraw internally.
However, if we look closely to the _consumeMessageAutoWithdraw we can see that it first ensures that the state of the message is not the CONSUMED and after that it sets it to CONSUMED. The issue here is that a message in the default state (NONE) will pass the check to not be CONSUMED. When in reality, the intended behavior is that a message can only be consumed once it is in READY state.
Even though this feature is currently disabled, the impact is that any message will be able to be auto withdrawn once the functionality becomes live.
Manual review
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.