You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 27, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
triggerEndEpoch() miss check vault.totalAssets() equals 0
Summary
triggerEndEpoch() miss check vault.totalAssets() equals 0, but it is possible, premium will lose
Vulnerability Detail
in triggerDepeg() have check vault.totalAssets() can't equal 0
function triggerDepeg(uint256_marketId, uint256_epochId) public {
...
// check if epoch qualifies for null epochif (
premiumVault.totalAssets(_epochId) ==0||
collateralVault.totalAssets(_epochId) ==0
) {
revertVaultZeroTVL();
}
but in triggerEndEpoch() don't check the vault.totalAssets() can't equal 0
the protocol does not limit the size of epochEnd-epochStart triggerEndEpoch() may not be called for some reason
Or the period is very short, triggerEndEpoch() may be maliciously called before triggerNullEpoch() is called
if this happens, and collateral.totalAssets () == 0 , premium will lose
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
bin2chen
medium
triggerEndEpoch() miss check vault.totalAssets() equals 0
Summary
triggerEndEpoch()
miss checkvault.totalAssets()
equals 0, but it is possible,premium
will loseVulnerability Detail
in triggerDepeg() have check vault.totalAssets() can't equal 0
but in
triggerEndEpoch()
don't check thevault.totalAssets()
can't equal 0the protocol does not limit the size of
epochEnd-epochStart
triggerEndEpoch()
may not be called for some reasonOr the period is very short,
triggerEndEpoch()
may be maliciously called beforetriggerNullEpoch()
is calledif this happens, and
collateral.totalAssets () == 0
,premium
will loseImpact
premium
may loseCode Snippet
https://github.com/sherlock-audit/2023-03-Y2K/blob/main/Earthquake/src/v2/Controllers/ControllerPeggedAssetV2.sol#L144
Tool used
Manual Review
Recommendation
Duplicate of #108
The text was updated successfully, but these errors were encountered: