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.
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.
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.
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: }
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.
Generating the AI write-up for this report.
This usually takes about 40 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
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.
Generating the AI write-up for this report.
This usually takes about 40 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
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.