Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.68 KB

Attackers can prevent honest users from performing an instant withdraw from the Wallet contract.md

File metadata and controls

29 lines (24 loc) · 1.68 KB

An attacker who sees an honest user’s call to MessageProcessor.instantWithdraw in the mempool can grab the oracleMessage and oracleSignature parameters from the user’s transaction, then submit their own transaction to instantWithdraw using the same parameters, a higher gas price (so as to frontrun the honest user’s transaction), and carefully choosing the gas limit for their transactions such that the internal call to the callInstantWithdraw will fail on line 785 with an out-of-gas error, but will successfully execute the if(!success) block.

The result is that the attacker’s instant withdraw will fail (so the user will not receive their funds), but the userInteractionNumber will be successfully reserved by the ReplayTracker.

As a result, the honest user’s transaction will revert because it will be attempting to use a userInteractionNumber that is no longer valid.

Recommendation:

Consider adding an access control mechanism to restrict who can submit oracleMessages on behalf of the user.


Slide Screenshot

080.jpg


Slide Text

  • OpenZeppelin Audit Futureswap V2 Finding H01
  • Timing/DoS
  • High Severity
  • Front-running
  • Prevent Instant Withdraw
  • Access Control
  • Submit oracleMessages

References


Tags