Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

kenzo - Timelocker can not execute transactions that send ETH value #346

Closed
sherlock-admin opened this issue Mar 27, 2023 · 0 comments
Closed
Labels
Non-Reward This issue will not receive a payout

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Mar 27, 2023

kenzo

medium

Timelocker can not execute transactions that send ETH value

Summary

When forwarding transactions, Timelocker tries to forward the number of ETH specified by the tx issuer, but the execute function is not payable.
So the Timelocker can not actually be used to execute transactions that need msg.value.

Vulnerability Detail

When executing a queued transaction, the timelocker sends the number of ETH specified by the user - _value.

        (bool ok, bytes memory res) = _target.call{value: _value}(data);

However, the execute function is not payable.

    function execute(
        address _target,
        uint256 _value,
        string calldata _func,
        bytes calldata _data,
        uint256 _timestamp
    ) external onlyOwner returns (bytes memory) {

Therefore, the user specified _value must always be 0, and transactions that need a transfer of ETH can not be executed at all.

Impact

Timelocker is not robust and can not execute transactions that need the usage of msg.value.
While at the moment there are no such transactions that are needed,
the timelocker implementation can not be changed once set (eg. in the vault factory),
and you'll probably want to use only one timelocker for all the protocol,
so I believe it's worth bringing this to your attention.

Code Snippet

We can see that execute is not payable, yet tries to forward _value to the call.

    function execute(
        address _target,
        uint256 _value,
        string calldata _func,
        bytes calldata _data,
        uint256 _timestamp
    ) external onlyOwner returns (bytes memory) {
        ...
        (bool ok, bytes memory res) = _target.call{value: _value}(data);

Also note that there is no receive or fallback function, so Timelock can not receive ETH.

Tool used

Manual Review

Recommendation

Add payable to execute.

Duplicate of #387

@github-actions github-actions bot closed this as completed Apr 3, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Apr 3, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Apr 11, 2023
@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Reward A payout will be made for this issue labels Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Non-Reward This issue will not receive a payout
Projects
None yet
Development

No branches or pull requests

1 participant