code4rena-2023-11-party-dao-m01

[M-01] Some arbitrary proposal calls will fail because executeProposal() in ProposalExecutionEngine is not payable

보고서

Summary

executeProposal 함수가 payable이 아니므로 msg.value 가 필요한 모든 제안이 실패하게 된다.

Keyword

payable, native token

Vulnerability

executeProposal 함수가 payable이 아니기 때문에 payable인 제안(msg.value를 필요로 하는 제안)은 처리할 수 없다.

    function executeProposal(
        ExecuteProposalParams memory params
@>  ) external onlyDelegateCall returns (bytes memory nextProgressData) {

따라서 임의의 콜을 하는 제안으로 ArbitraryCallsProposal._executeArbitraryCalls를 호출했을 때 msg.value가 전달될 수 없다. allowArbCallsToSpendPartyEth 파라미터가 false 라면 컨트랙트에 예치된 ETH는 사용할 수 없고, msg.value로 전달된 ETH만 사용할 수 있다. 하지만 executeProposal 가 payable이 아니므로 msg.value를 전달할 수 없다.

    function _executeArbitraryCalls(
        IProposalExecutionEngine.ExecuteProposalParams memory params,
        bool allowArbCallsToSpendPartyEth
    ) internal returns (bytes memory nextProgressData) {
        ...
        // If we're not allowing arbitrary calls to spend the Party's ETH, only
        // allow forwarded ETH attached to the call to be spent.
@>      uint256 ethAvailable = allowArbCallsToSpendPartyEth ? address(this).balance : msg.value;

Impact

함수 호출자에게 ETH를 받아서 실행해야 하는(msg.value가 필요한) 모든 제안이 실패한다.

Mitigation

executeProposal 함수를 payable로 변경한다.


tags: bughunting, party dao, smart contract, solidity, solidity payable, native token, severity medium