You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
sherlock-admin opened this issue
May 24, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
Price reading from Uniswap pool can be manipulated
Summary
USSDRebalancer is reading the price of the USSD/DAI pair directly from the pool, this price can be manipulated using flashloan for the attacker's profit.
Vulnerability Detail
USSDRebalancer calculate the price of USSD/DAI using the function getOwnValuation, first read the price directly from pool and here is where the problem is originating, as the contract reads the price directly from the pool and is not using the twap oracle, the price can be manipulated atomically using a flash loan to inflate the price of one asset.
Impact
The price that is read can be manipulated through the flash loan.
POC:
Take flashLoan to inflate the pool price.
Buy USSD for nothing ( a few DAI cents for millions of USSD )
Call rebalance function where the USSD will try to rebalance the USSD/DAI pool
Sell back the USSD at normal price + profit and pay the flash loan
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
theOwl
high
Price reading from Uniswap pool can be manipulated
Summary
USSDRebalancer is reading the price of the USSD/DAI pair directly from the pool, this price can be manipulated using flashloan for the attacker's profit.
Vulnerability Detail
USSDRebalancer calculate the price of USSD/DAI using the function getOwnValuation, first read the price directly from pool and here is where the problem is originating, as the contract reads the price directly from the pool and is not using the twap oracle, the price can be manipulated atomically using a flash loan to inflate the price of one asset.
Impact
The price that is read can be manipulated through the flash loan.
POC:
Code Snippet
https://github.com/sherlock-audit/2023-05-USSD/blob/6d7a9fdfb1f1ed838632c25b6e1b01748d0bafda/ussd-contracts/contracts/USSDRebalancer.sol#L72
https://github.com/sherlock-audit/2023-05-USSD/blob/6d7a9fdfb1f1ed838632c25b6e1b01748d0bafda/ussd-contracts/contracts/USSDRebalancer.sol#L93
Tool used
Manual Review
Recommendation
Read the price using Uniswap TWAP instead of reading it directly from the pool
Duplicate of #451
The text was updated successfully, but these errors were encountered: