-
Notifications
You must be signed in to change notification settings - Fork 1
Update VaultFreezer.sol #14
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Freeze state is unenforced, allowing vault operations despite freezingDescription:TL;DR: In the DetailsThe vulnerability originates from the absence of freeze-state checks in the functions that manage vault operations. Although the ImpactBy allowing operations to proceed on a vault that should be frozen, an attacker or misconfigured system may trigger actions such as unauthorized fund withdrawals, alteration of vault states, or reward distributions. This can lead to direct financial losses, breaches of protocol invariants, and potential protocol corruption. Mitigation Steps:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrestricted freezeVault Enables Arbitrary Vault Freezing Without Access Control
Description:
TL;DR:
The
freezeVaultfunction in theVaultFreezercontract lacks access control, allowing any address to mark any vault as frozen, potentially enabling a denial-of-service in future protocol logic.In the
VaultFreezercontract, thefreezeVaultfunction (atsrc/VaultFreezer.sol:38) can be called by any address because it lacks role-based restrictions. This vulnerability permits arbitrary freezing of vaults, which may lead to operational disruptions if downstream functions enforce theisFrozenflag.Details
The
freezeVaultfunction is defined without any access control checks. Unlike theunfreezeVaultfunction, which is restricted using theonlyRole(FREEZER_ROLE)modifier,freezeVaultsets the state variableisFrozentotruefor a given vault address without verifying the caller's authorization. The relevant code snippet is as follows:The absence of a role check means that any externally owned account or contract can freeze any vault. Although the current implementation does not enforce additional behavior based on the
isFrozenflag, it is noted in the protocol documentation and code context that this flag may be used downstream to restrict vault operations such as withdrawals, rewards distribution, or administrative changes. This leads to a potential denial-of-service (DoS) situation in the future if theisFrozenflag is utilized to gate critical functionalities.Impact
If exploited, an attacker could arbitrarily freeze vaults, preventing legitimate operations such as withdrawals, rewards claims, or administrative updates. This vulnerability may lead to a partial or complete denial-of-service against the protocol, resulting in potential lock-up of user funds and disruption of protocol operations, should downstream logic enforce restrictions based on the
isFrozenflag.Mitigation Steps:
Restrict the
freezeVaultfunction with an appropriate access control modifier (e.g.,onlyRole(FREEZER_ROLE)) to ensure that only authorized addresses can freeze vaults.-Conduct a thorough review of the downstream logic where the
isFrozenflag is used and ensure that its enforcement aligns with the intended protocol security model.