You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the original MagicSpend implementation there were insufficient checks that the MagicSpend contract had enough ETH to cover all the withdrawal requests in a UserOps bundle.
Mitigation
To mitigate this _validateRequest (called inside of validatePaymasterUserOp) allows requests to only request a fraction of the contracts ether balance meaning maxWithdrawDenominator amount of requests could be processed in a UserOps bundle without the contract unexpectedly running out of funds to cover withdrawals.
Conclusion
The mitigations made should fix this issue, providing maxWithdrawDenominator is set to a high enough value to cover the maximum possible user operations that can put into a single UserOps bundle.
However as the withdraw function also calls _validateRequest it is necessary that the contract has maxWithdrawDenominator times more than the maximum withdraw amount that can be signed for else their otherwise valid WithdrawRequest's will revert.
The text was updated successfully, but these errors were encountered:
Lines of code
Vulnerability details
Comments
In the original
MagicSpend
implementation there were insufficient checks that theMagicSpend
contract had enough ETH to cover all the withdrawal requests in aUserOps
bundle.Mitigation
To mitigate this
_validateRequest
(called inside ofvalidatePaymasterUserOp
) allows requests to only request a fraction of the contracts ether balance meaningmaxWithdrawDenominator
amount of requests could be processed in aUserOps
bundle without the contract unexpectedly running out of funds to cover withdrawals.Conclusion
The mitigations made should fix this issue, providing
maxWithdrawDenominator
is set to a high enough value to cover the maximum possible user operations that can put into a singleUserOps
bundle.However as the
withdraw
function also calls_validateRequest
it is necessary that the contract hasmaxWithdrawDenominator
times more than the maximum withdraw amount that can be signed for else their otherwise validWithdrawRequest
's will revert.The text was updated successfully, but these errors were encountered: