This repository has been archived by the owner on Oct 1, 2023. It is now read-only.
ShadowForce - User can avoid paying deposit fee #318
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Escalation Resolved
This issue's escalations have been approved/rejected
High
A valid High severity issue
Reward
A payout will be made for this issue
ShadowForce
medium
User can avoid paying deposit fee
Summary
user can bypass deposit fee if id is set to 0
Vulnerability Detail
In the
_depostit
function the logic charges a fee only if a the id is set to anything else but 0. A user can set the epoch id to 0 in the queue and completely avoid paying such deposit fee when he goes to mint. The protocol does not collect a deposit fee from user when in fact it should have collected said fee. We can view the logic down belowThis can be further seen by looking at the snippet below. When shares are minted through deposit queue, no fees are charged
As we can see if user is depositing via que and not direct deposit, he can avoid paying fee by setting the epoch id to 0
Impact
The protocol does not collect a deposit fee from user when in fact it should have collected said fee. This is a direct loss of funds for the protocol.
Code Snippet
https://github.com/Y2K-Finance/Earthquake/blob/736b2e1e51bef6daa6a5ecd1decb7d156316d795/src/v2/Carousel/Carousel.sol#L465-L501
https://github.com/Y2K-Finance/Earthquake/blob/736b2e1e51bef6daa6a5ecd1decb7d156316d795/src/v2/Carousel/Carousel.sol#L328-L350
Tool used
Manual Review
Recommendation
we recommend the protocol adds checks to ensure a user pays fees when he should.
Duplicate of #75
The text was updated successfully, but these errors were encountered: