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

Vault staking request to a DSS cannot be canceled, putting user funds at risk in the case of a malicios DSS #26

Closed
c4-bot-3 opened this issue Jul 30, 2024 · 2 comments
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working insufficient quality report This report is not of sufficient quality 🤖_20_group AI based duplicate group recommendation unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-bot-3
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2024-07-karak/blob/main/src/Core.sol#L146

Vulnerability details

Impact

If an operator no longer wants to stake a vault after submitting a vault staking request, it is not able to cancel that request. Considering the scenario of a malicios/compromised DSS, an operator staking a vault will not be able to cancel their staking request. Furthermore, by design anyone can finalize a staking request. This would put operators at risk of unfair slashing of their funds. This risk is somewhat mitigated by the veto committee which can cancel slashing requests. At the very least the vault funds will be unsuable for the unstaking + staking to new DSS duration of 18 days.

Proof of Concept

There is no function to cancel a staking request and the finalizeUpdateVaultStakeInDSS() function is callable by anyone:

    /// @notice Allows anyone to finish the queued request for an operator to update assets delegated to a DSS
    /// @dev Only operator can finish their queued request valid only after a
    /// minimum delay of `Constants.MIN_STAKE_UPDATE_DELAY` after starting the request
    function finalizeUpdateVaultStakeInDSS(Operator.QueuedStakeUpdate memory queuedStake)
        external
        nonReentrant
        whenFunctionNotPaused(Constants.PAUSE_CORE_FINALIZE_STAKE_UPDATE)
    {
        _self().validateAndUpdateVaultStakeInDSS(queuedStake);
        emit FinishedStakeUpdate(queuedStake);
    }

This means a malicios DSS can finalize vault staking requests even when this is not desireable by the operator.

Consider the following scenario:

An operator wants to stake its vault to a DSS, so it submits a vault staking request via requestUpdateVaultStakeInDSS(). This would set a timer of MIN_STAKE_UPDATE_DELAY = 9 days after which the request can be finalized.

During this time of 9 days, the DSS turns out to be malicios and is unfairly slashing user funds.

The operator cannot remove his request and the malicios DSS finilizes the request by calling finalizeUpdateVaultStakeInDSS() and then slashes the user funds.

The veto commitee does not react on time and the operator loses his funds. Note that even if the veto committee reacts on time, the user funds will be unusable for the duration of unstaking the vault(9) and staking it to a new DSS(another 9 days), since there can be only one stake/unstake request per vault at a time.

Tools Used

Manual Review

Recommended Mitigation Steps

Allow operators to cancel vault staking requests

Assessed type

Other

@c4-bot-3 c4-bot-3 added 3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working labels Jul 30, 2024
c4-bot-5 added a commit that referenced this issue Jul 30, 2024
@c4-bot-13 c4-bot-13 added the 🤖_20_group AI based duplicate group recommendation label Jul 30, 2024
@howlbot-integration howlbot-integration bot added the insufficient quality report This report is not of sufficient quality label Aug 1, 2024
@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Aug 11, 2024
@c4-judge
Copy link
Contributor

MiloTruck marked the issue as unsatisfactory:
Invalid

@MiloTruck
Copy link

This is a design suggestion and not a bug.

There is no issue if vault staking requests cannot be cancelled. Additionally, it is the operator's responsibility to ensure the DSS he chooses does not turn malicious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working insufficient quality report This report is not of sufficient quality 🤖_20_group AI based duplicate group recommendation unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

4 participants