Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OperatorProposal._executeOperation() should refund excess ETH #30

Closed
code423n4 opened this issue Apr 14, 2023 · 7 comments
Closed

OperatorProposal._executeOperation() should refund excess ETH #30

code423n4 opened this issue Apr 14, 2023 · 7 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-5 judge review requested Judge should review this issue satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2023-04-party/blob/440aafacb0f15d037594cebc85fd471729bcb6d9/contracts/proposals/OperatorProposal.sol#L40-L45

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 > 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.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Apr 14, 2023
code423n4 added a commit that referenced this issue Apr 14, 2023
@0xean
Copy link

0xean commented Apr 15, 2023

On the fence on this one, presumably the call is made with with the correct msg.value to facilitate the transaction. Will leave open for sponsor comment, but most likely this should be QA

@c4-judge
Copy link

0xean marked the issue as primary issue

@c4-judge c4-judge added the primary issue Highest quality submission among a set of duplicates label Apr 15, 2023
@c4-sponsor c4-sponsor added the judge review requested Judge should review this issue label Apr 17, 2023
@c4-sponsor
Copy link

0xble requested judge review

@0xble
Copy link

0xble commented Apr 17, 2023

Isn't this a duplicate of #5?

@0xean
Copy link

0xean commented Apr 25, 2023

Yes, good catch.

@c4-judge
Copy link

0xean marked the issue as duplicate of #5

@c4-judge c4-judge added duplicate-5 and removed primary issue Highest quality submission among a set of duplicates labels Apr 25, 2023
@c4-judge
Copy link

0xean marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-5 judge review requested Judge should review this issue satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

5 participants