Open hats-bug-reporter[bot] opened 4 months ago
No changes are required. Our protocol calculates the actual ratio based on the deposited amounts. This ensures that if an amount overflows uint160 and gets truncated to 1 wei, the resulting ratio would be close to 0, causing the deposit to fail. The protocol's design inherently protects against this issue by using actual ratios, which prevents the loss of funds as described in the attack scenario.
@deadrosesxyz
Correct, I was missing full context at the time of submission. This issue can be closed as invalid.
Github username: @@deadrosesxyz Twitter username: @deadrosesxyz Submission hash (on-chain): 0xd9ac8a6899d0a885ac2141fab997cca1d146f1930e67629f056d635a731cc218 Severity: high
Description: Description\ Attacker can steal all portfolio assets due to silent overflow
Attack Scenario\ When depositing funds in the contract,
depositAmounts
is passed as auint256
array.However, within
_transferToVaultWithPermit
it is truncated touint160
.This allows for the following attack
uint160.max + 1
uint160.max + 1
is used, hence the user will obtain pretty much all liquiditypermit2
is called, value is truncated to just 1 wei.Attachments
Proof of Concept (PoC) File
Revised Code File (Optional)