Skip to content
Business logic Audit finding Intermediate

Excess eth is not refunded

The ArbitraryCallsProposal contract does not refund excess ETH sent by the user when the total value of the calls is less than msg.value. An attacker could cause the excess ETH to remain stuck in the contract.

Anurag Jain Follow

Originally disclosed on Code4rena

Submitted by csanuragjain

The ArbitraryCallsProposal contract requires sender to provide eth(msg.value) for each call. Now if user has provided more eth than combined call.value then this excess eth is not refunded back to user.

Proof of Concept

  1. Observe the _executeArbitraryCalls function
function _executeArbitraryCalls(
        IProposalExecutionEngine.ExecuteProposalParams memory params
    )
        internal
        returns (bytes memory nextProgressData)
    {

...
uint256 ethAvailable = msg.value;
        for (uint256 i = 0; i < calls.length; ++i) {
            // Execute an arbitrary call.
            _executeSingleArbitraryCall(
                i,
                calls[i],
                params.preciousTokens,
                params.preciousTokenIds,
                isUnanimous,
                ethAvailable
            );
            // Update the amount of ETH available for the subsequent calls.
            ethAvailable -= calls[i].value;
            emit ArbitraryCallExecuted(params.proposalId, i, calls.length);
        }
....
}
  1. As we can see user provided msg.value is deducted with each calls[i].value
  2. Assume user provided 5 amount as msg.value and made a single call with calls[0].value as 4
  3. This means after calls have been completed ethAvailable will become 5-4=1
  4. Ideally this 1 eth should be refunded back to user but there is no provision for same and the fund will remain in contract

Recommended Mitigation Steps

At the end of \_executeArbitraryCalls function, refund the remaining ethAvailable back to the user.

merklejerk (PartyDAO) confirmed and commented:

Will refund unused ETH at the end of executing arbitrary calls.

0xble (PartyDAO) resolved:

Resolved: https://github.com/PartyDAO/partybidV2/pull/135

HardlyDifficult (judge) commented:

This is a form of leaking value - agree with Medium risk.


The original report as published on Code4rena, by csanuragjain. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the function does not refund the remaining ETH after executing all calls.

Impact

Excess ETH sent by the user remains stuck in the contract, causing a loss of funds for the user.

What the attacker needed

User sends more ETH than needed for calls

The fix

The function should refund the remaining ETH to the user after executing all calls; the project confirmed and later resolved this.

How it was found

  1. Observe the _executeArbitraryCalls function.
  2. User provides msg.value greater than the sum of calls[i].value.
  3. After all calls, ethAvailable is greater than zero.
  4. The excess ETH is not refunded and remains in the contract.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When you send a proposal that makes several calls, you also send some ETH to pay for those calls. If you send more ETH than needed, the extra should be returned to you. Here, the extra ETH stays in the contract instead of being refunded.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by Anurag Jain

View all

63 more disclosed reports, best first.

More from Party Protocol

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.