Lucene search

K
code423n4Code4renaCODE423N4:2023-04-PARTY-FINDINGS-ISSUES-30
HistoryApr 14, 2023 - 12:00 a.m.

OperatorProposal._executeOperation() should refund excess ETH

2023-04-1400:00:00
Code4rena
github.com
4
operatorproposal
refund
excess eth
executeoperation
mitigation
excess amount

Lines of code

Vulnerability details

Impact

There are excess ETH in OperatorProposal._executeOperation, and it should be refunded.

Proof of Concept

OperatorProposal._executeOperation runs data.operator.execute with data.operatorValue of ETH.

    data.operator.execute{ value: data.operatorValue }(data.operatorData, executionData); 

When allowOperatorsToSpendPartyEth is false, it works when data.operatorValue <= msg.value.

        if (!allowOperatorsToSpendPartyEth && data.operatorValue &gt; msg.value) {
            revert NotEnoughEthError(data.operatorValue, msg.value);
        }

So only data.operatorValue will be used out of msg.value when allowOperatorsToSpendPartyEth is false. We should refund the excess amount.

Tools Used

Manual Review

Recommended Mitigation Steps

We should refund msg.value - data.operatorValue when allowOperatorsToSpendPartyEth is false.


The text was updated successfully, but these errors were encountered:

All reactions