hats-finance / Velvet-Capital-0x0bb0c08fd9eeaf190064f4c66f11d18182961f77

Core smart contracts of Velvet Capital
Other
0 stars 1 forks source link

Attacker can keep DOSing any user's withdrawals by deposting minimum possible tokens on behalf of him. #101

Open hats-bug-reporter[bot] opened 2 months ago

hats-bug-reporter[bot] commented 2 months ago

Github username: @burhankhaja Twitter username: imaybeghost Submission hash (on-chain): 0x8719db4eac90d7b4f6167e5bbe7d56f2f8ade8d544c0f04489a1e3ccb2aeb622 Severity: high

Description: Description\ Both the deposit functions multiTokenDeposit() && multiTokenDepositFor() increase the cooldown period of an address for which deposits are being made.

Since multiTokenDepositFor() allows anyone to deposit tokens on behalf of any address and the withdrawals for an address are not allowed before the its cooldown period has passed,

A malicous attacker can frontrun users withdrawal requests and deposit minimum possible tokens on behalf of him in order to increase his cooldown period, As a result User will be prevented for withdrawing his tokens.

The attacker can automate this attack and re-attack every once in a while after the cooldownperiod is about to finish which will halt user withdrawals for a very long time with lesser attack costs.

multiTokenDepositFor() --> _depositAndMint() --> _mintTokenAndSetCooldown()

Attack Scenario\ .

Impact\ Sky-rocketing loss of User fund

In a situation, where portfolio is performing bad, imagine a whale investor is attacked, and his withdrawal txns are blocked, his net losses will skyrocket in millions of dollars.

Imagine competitors organizing this attack on large scale and targeting whale wallets of rival portfolios.

Aside from that even if user's withdrawals are delayed for single day, business image of the portfolio will be destroyed and will loose large number of investor.

Attachments

  1. Proof of Concept (PoC) File

  2. Revised Code File (Optional)

langnavina97 commented 2 months ago

Duplicate #12