Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WildSniper - The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. #297

Closed
sherlock-admin4 opened this issue Jun 27, 2024 · 0 comments
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin4
Copy link
Contributor

sherlock-admin4 commented Jun 27, 2024

WildSniper

Medium

The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses.

Summary

The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses.

Vulnerability Detail

The registerWithdrawal function in the Vault contract permits users to specify a to address, which is the recipient address for the withdrawal request. This opens up a potential attack vector where a malicious user can repeatedly register withdrawal requests to blacklisted addresses, causing subsequent withdrawal operations to revert when attempting to process these requests.

Impact

The impact of this vulnerability is considered medium. It has the potential to break core contract functionality by disrupting the withdrawal process. If operators are forced to process withdrawals individually to avoid blacklisted addresses, it could lead to delays and inefficiencies. In a worst-case scenario, users might be compelled to initiate emergency withdrawals, potentially resulting in the loss of funds.

Code Snippet

The relevant code snippets are:

https://github.com/sherlock-audit/2024-06-mellow/blob/26aa0445ec405a4ad637bddeeedec4efe1eba8d2/mellow-lrt/src/Vault.sol#L434-L473

function registerWithdrawal(
    address to,
    uint256 lpAmount,
    uint256[] memory minAmounts,
    uint256 deadline,
    uint256 requestDeadline,
    bool closePrevious
) external nonReentrant checkDeadline(deadline) checkDeadline(requestDeadline) {
    // ...
    WithdrawalRequest memory request = WithdrawalRequest({
        to: to, // Arbitrary 'to' address
        // ...
    });
    // ...
}
function pendingWithdrawers(
    uint256 limit,
    uint256 offset
) external view returns (address[] memory result) {
    // ...
    for (uint256 i = 0; i < count; i++) {
        result[i] = withdrawers_.at(offset + i);
    }
    return result;
}

Tool used

Manual Review

Recommendation

To mitigate this vulnerability, the Vault contract should implement a mechanism to validate the to address in the registerWithdrawal function. This could involve maintaining a list of approved or blacklisted addresses and checking the to address against this list before allowing the withdrawal request to be registered. or to check by a call to usdc contract

Additionally, the processWithdrawals function should be modified to skip or handle withdrawal requests to blacklisted addresses gracefully, without reverting the entire operation.

Duplicate of #109

@sherlock-admin2 sherlock-admin2 changed the title Clumsy Clay Mole - DepositWrapper.deposit(): incorrect handling of steth token transfer The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. Jun 28, 2024
@sherlock-admin3 sherlock-admin3 added the Sponsor Disputed The sponsor disputed this issue's validity label Jun 30, 2024
@github-actions github-actions bot changed the title The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. Perfect Coral Anteater - The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. Jul 6, 2024
@github-actions github-actions bot closed this as completed Jul 6, 2024
@github-actions github-actions bot added the Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label label Jul 6, 2024
@sherlock-admin3 sherlock-admin3 changed the title Perfect Coral Anteater - The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. WildSniper - The Vault contract in the Mellow protocol allows users to register withdrawal requests to an arbitrary address, potentially enabling malicious actors to disrupt the withdrawal process by registering withdrawals to blacklisted addresses. Jul 15, 2024
@sherlock-admin3 sherlock-admin3 added Non-Reward This issue will not receive a payout and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Non-Reward This issue will not receive a payout Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

2 participants