execute in VoteProxy should be payable
The execute function in VoteProxy lacks the payable modifier, so it reverts when called with a non-zero Ether value. An attacker cannot exploit this directly, but it prevents the owner from sending Ether through the proxy.
Submitted by wuwe1
execute will revert when msg.value > 0
Proof of Concept
Lacking payable mutability specifier.
function execute(
address _to,
uint256 _value,
bytes calldata _data
) external onlyOwner returns (bool, bytes memory) {
(bool success, bytes memory result) = _to.call{value: _value}(_data);
return (success, result);
}
Recommended Mitigation Steps
Add payable mutability specifier.
Alex the Entreprenerd (judge) commented:
@leekt Can you tell me what you’d need
executeto be used for?Do you really need it to be payable?
Alex the Entreprenerd (judge) commented:
After some thinking, I do believe that it would be wise to allow for payable calls.
Will mark as valid and because this is contingent on a specific usage, I think Medium Severity to be appropriate.
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 execute function lacks the payable mutability specifier, so it cannot receive Ether.
What the attacker needed
Owner calls execute with Ether
The fix
Add the payable mutability specifier to the execute function.
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.
In Ethereum smart contracts, a function must be marked 'payable' to accept Ether (the cryptocurrency). Without that label, any attempt to send Ether along with a function call will fail and revert the transaction. This report points out that the execute function is missing that label, so it cannot be used to forward Ether.
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.