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 23, 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
getOwnValuation() uses the uniPool.slot0 to determine the number of tokens it has in it's position. slot0 is the most recent data point and can easily be manipulated.
Attackers can leverage flash swaps to borrow assets from the pool, manipulate the square root price through a series of trades, and then return the borrowed assets. This manipulation impacts subsequent price calculations, including those performed in the getOwnValuation() function.
Impact
The impact could be significant. If an attacker is able to manipulate the price of the token in the Uniswap pool, they could then buy or sell the token at an unfair price. This could lead to users and protocol to loose money
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
BugBusters
high
USSDRebalancer.sol
is easy is manipulate due to how how it calculates price ingetOwnValuation
functionSummary
The
getOwnValuation()
function is vulnerable to price manipulation, which can lead to inaccurate price estimations and financial losses. The vulnerability arises due to the reliance on the Uniswap V3slot0()
without considering the possibility of price manipulation by attackers.https://github.com/sherlock-audit/2023-05-USSD/blob/6d7a9fdfb1f1ed838632c25b6e1b01748d0bafda/ussd-contracts/contracts/USSDRebalancer.sol#L71-L80
Vulnerability Detail
getOwnValuation()
uses theuniPool.slot0
to determine the number of tokens it has in it's position. slot0 is the most recent data point and can easily be manipulated.Attackers can leverage flash swaps to borrow assets from the pool, manipulate the square root price through a series of trades, and then return the borrowed assets. This manipulation impacts subsequent price calculations, including those performed in the
getOwnValuation()
function.Impact
The impact could be significant. If an attacker is able to manipulate the price of the token in the Uniswap pool, they could then buy or sell the token at an unfair price. This could lead to users and protocol to loose money
Code Snippet
Tool used
Manual Review
Recommendation
Use a TWAP instead of slot0.
Duplicate of #451
The text was updated successfully, but these errors were encountered: