Skip to content
Business logic Audit finding Intermediate

Some arbitrary proposal calls will fail because executeProposal() in ProposalExecutionEngine is not payable

The executeProposal function in ProposalExecutionEngine is not marked payable, so any proposal that forwards ether via msg.value will revert. This prevents the Party from executing arbitrary-call proposals that need to spend attached ETH.

Arz Follow with HChang26 and Vagner

Originally disclosed on Code4rena

Submitted by Arz, also found by HChang26 and Vagner

The executeProposal() function in ProposalExecutionEngine.sol is used to execute different types of proposal call. One of this type is ArbitraryCallsProposal and this type should be able to send ether from the Party’s balance or the forwarded ETH attached to the call msg.value. However, the problem is that the executeProposal() function is not marked as payable and all calls that are sending ether and using msg.value will fail because of that.

Note: Even though this function is delegate-called from PartyGovernance.sol::execute(), which is payable the msg.value, it is still preserved when delegatecall is used and the function called needs to be payable.

Impact

All proposal calls that are using attached ether will fail and Party wont be able to execute these types of proposals, which can be important.

Proof of Concept

https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/proposals/ProposalExecutionEngine.sol#L146-L148

146:   function executeProposal(
147:     ExecuteProposalParams memory params
148:   ) external onlyDelegateCall returns (bytes memory nextProgressData) {

As you can see, the executeProposal() function is not payable; however, later it then calls _executeArbitraryCalls():

https://github.com/code-423n4/2023-10-party/blob/b23c65d62a20921c709582b0b76b387f2bb9ebb5/contracts/proposals/ArbitraryCallsProposal.sol#L72-L74

72:  // If we're not allowing arbitrary calls to spend the Party's ETH, only
73:  // allow forwarded ETH attached to the call to be spent.
74:  uint256 ethAvailable = allowArbCallsToSpendPartyEth ? address(this).balance : msg.value;

As you can see and as the comment suggests, the call should be able to use the forwarded ether attached to the call and ethAvailable is then used in _executeSingleArbitraryCall(). However, because the function is not payable, the call will revert.

Recommended Mitigation Steps

Make the executeProposal() function payable.

Assessed type

Payable

KingNFT (lookout) commented:

Seems right, EVM source code:

File: core\vm\contract.go
134: func (c *Contract) AsDelegate() *Contract {
135: 	// NOTE: caller must, at all times be a contract. It should never happen
136: 	// that caller is something other than a Contract.
137: 	parent := c.caller.(*Contract)
138: 	c.CallerAddress = parent.CallerAddress
139: 	c.value = parent.value
140:
141: 	return c
142: }

arr00 (Party) confirmed


The original report as published on Code4rena, by Arz. 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

The executeProposal function lacks the payable modifier, so it cannot receive the msg.value forwarded through the delegatecall.

Impact

Proposals that attach ether will revert, so the Party cannot execute these types of proposals.

What the attacker needed

A proposal that forwards ether

The fix

The executeProposal function should be made payable.

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.

A smart contract function can be marked 'payable' to accept ether sent along with a call. Here the function that runs proposals was not payable, so any proposal that tried to send ether with it was rejected and the whole proposal failed.

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 Arz

View all

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