Open hats-bug-reporter[bot] opened 3 days ago
Yeah, seems like a valid issue
Judging by previous comments, isn't the usage of the previous price a protective mechanism against arbitrage? In case the Oracle malfunctions, the owner can manually update the price to keep the protocol running and solvent. I see no issue currently, users should be aware that holding the deposit for 1 price update is mandatory to avoid losses.
Alright, I read this more carefully and @PlamenTSV is right, this submissions puts emphasis on previous and current price, which is intended design. But there is the issue I understood when first looking at this, and the submitter also seems to hint at this - that convertToShares
which uses currentPrice
is being used in both deposit()
and withdraw()
(while the idea is when investing currentPrice
is used and when selling previousPrice
is used).
This was the first submission that first hinted at this, but the submitter might have misunderstood the intended behavior.
Since the scope of currentPrice and previousPrice are explained in the README, and there were some submissions which explained the issue more precisely relative to the intended behavior, it might be fair to reward one of those. We'll come up with a decision in the coming days.
Github username: -- Twitter username: ACai_sec Submission hash (on-chain): 0x33d536198fecda7c86619265c0e63f9b8400261c847e74836e4591b11fa232c7 Severity: medium
Description: Description\ A vulnerability exists in the price calculation mechanism between deposits and withdrawals in the InvestToken contract. The issue arises due to inconsistent price references when converting between assets (USDE) and shares, potentially causing users to suffer losses during emergency withdrawals.
Attack Scenario\
Consider the following scenario:
Initial state:
Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)