-
Notifications
You must be signed in to change notification settings - Fork 1
kenzo - Ineffective timelocker due to epoch length #181
Comments
considering this |
fix PR: Y2K-Finance/Earthquake#138 |
Escalate for 10 USDC. The README makes a clear distinction between Admin and Timelock: So the statement |
You've created a valid escalation for 10 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Escalate for 10 USDC The previous escalator's escalation reasoning seems wrong to me and I'd like to explain why.
Even if the statement The project has added a timelock to add a guarantee to users that their funds can not be stolen via changing parameters like the Controller or Oracle. I can imagine the Twitter threads if this was to be exploited... "The sensitive functions were kept behind a timelock, but the timelock's duration was shorter than the amount of time that user funds were locked. So users could do nothing and only watch while they waited for their assets to be stolen". We can also see that the sponsor confirmed the issue and fixed it. Therefore, I believe a medium severity is appropriate. |
You've created a valid escalation for 10 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
Escalation accepted Valid low Sponsor comment:
|
This issue's escalations have been accepted! Contestants' payouts and scores will be updated according to the changes made on this issue. |
kenzo
medium
Ineffective timelocker due to epoch length
Summary
The timelocker has a timelock of 3 days, while the epochs length is 7 or 30 days.
Users can not withdraw their funds after an epoch has started.
This renders the timelock ineffective, as users can not withdraw their funds while a malicious timelock transaction is pending,
and the admin can rug the protocol.
Vulnerability Detail
The Y2K docs state that epochs locking period will be weekly and monthly.
The contest readme states that
Admin Should not be able to steal user funds
.To mitigate against such risk, a timelocker has been added.
It sets the waiting period as such:
So a transaction has to wait for a minimum of 3 days.
But since epochs last for a week or a month (as per the documentation),
a user that has locked his funds for such a period can not withdraw them in the 3 days of timelock.
He can not effectively do anything to save his funds in case of malicious or compromised admin.
The contest readme states that
Admin Should not be able to steal user funds
.But for example an admin can rug in the following way:
Once an epoch has started, queue a tx that whitelists his own address for the vault (
whitelistAddressOnMarket
), then queue a tx that whitelists his EOA as controller (whitelistController
), then queue a tx that changes the controller to his EOA (changeController
), and after 3 days, he'll execute them all, and use his EOA to callsendTokens
in the vault and send himself all the user funds.Impact
Timelock is not effective.
Admin can rug user funds, which according to the contest readme, should not be possible.
Code Snippet
Tool used
Manual Review
Recommendation
I believe that for the timelock to be effective, it has to have a minimum delay which is longer than the epoch's duration.
The text was updated successfully, but these errors were encountered: