Open hats-bug-reporter[bot] opened 10 months ago
Mock is not intended for mainnet so it shouldn't be based its parameters. Wormhole's fee is currently free but exepected to be non-zero in the future.
I do not agree with the fix. The fix is to either add msg.sender
or msg.origin
to https://github.com/catalystdao/GeneralisedIncentives/blob/2448d77e412216283ed75d8c3cbaa1270657f7b5/src/IncentivizedMessageEscrow.sol#L81.
We will figure out severity.
That would be a partial fix imo, because he would still be able to create a bounty of any incentive size, be it incredibly large. Thus he can still trick any relayer into wasting gas attempting to process it. I believe at least the incentive should be validated as well.
But then the only person who could DoS you would be yourself.
Relayers are aware of the incentive and won't process messages with a too low incentive.
Yes but they would attempt to relay those with high incentives, which we can create, even above the max limit due to the missing validation check. And I do not know if the off-chain system has a way to indicate to relayers which bounties have been failed or are unclaimable, so any relayer could get tricked.
Sorry, I don't understand that case.
It is very likely that there is going to be a perpetual number of bounties active since the incentives have been set too low. However, there are not going to cause any problem since they do not block other messages. Relayer's also doesn't care about these but will generally just discard them from their list until they see increaseBounty
.
A few key notes that come to mind for when time for judging comes:
submitMessage
we can set our incentive to be with 0 values for the relay prices, making us pay no fees (because wormhole is free per the above comments). So the attack is pretty much automatable for MEV and a greater scale of DoS.fromApplication
is set to msg.sender
but that can be our own contract we do the attack from. toApplication
is set inside the initial message we have crafted. Thus even if there is a price in the future, if we process our own message we used for the DoS and just return successful ack's from our contract, we can reclaim our own bounty, thus making this attack free again.I think you misunderstood how the inputs work. https://github.com/catalystdao/GeneralisedIncentives/blob/2448d77e412216283ed75d8c3cbaa1270657f7b5/src/apps/mock/IncentivizedMockEscrow.sol#L33-L45
1.
The only tainted inputs here is message
and destinationIdentifier
. The other are only soft-tainted but cannot be controled in the past or the future. block.number is uncorrolated of message
in the hash.
3.
Aware. That is why the fix is to add msg.sender
to the message identifier.
We have decided to classify this issue as Medium. Our decision is based on the following arguments:
The proposed fix is bad. msg.sender
will be added to the message identifier. It is then up to the application to ensure that they themselves do not DoS users.
Github username: @PlamenTSV Twitter username: @p_tsanev Submission hash (on-chain): 0x385fa5aa56faa32b4afd01cf4981de931162478f85b6fe50e260c0bcb2a2254c Severity: low
Description: Description\ The
submitMessage
function of the escrow is a follow up function when a user sends assets/liquidity cross-chain and is meant to set the message's bounty/reward for the relayer and to send the packet of data. Due to it lacking access control and some input validation, it is vulnerable to several vectors.Attack Scenario The first scenario that comes to mind:
submitMessage
destinationIdentifier
,destinationAddress
andmessage
since the encoding they need to be made is known thus can be replicated (for the message he would simply replace the msg.sender with the address of the front-runned user) ; provide any kind of incentive he wants, due to the missingcheckRouteDescription
modifier that validates the incentives ; set the bounty of the front-runned message to his arbitrary incetive, since the identifier relies only on the destination and the message itself which are both crafter maliciously.The above scenario has a few limitations which are the reasons I give it an initial LOW severity:
block.number
thus a user can retry again next block.The current impacts, disregarding the potential MEV spam are:
I would love if the sponsors could comment what the wormhole's message fee and the mock's cost of messages would be so we can discuss further severity/impact. Currently LOW is fine IMO Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)
The recommendation is quite simple in 2 modifiers:
onlyChainInterface
andcheckRouteDescription