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
Spot price in getOwnValuation() could be manipulated
Summary
getOwnValuation() is using uniPool.slot0() to get the spot price sqrtPriceX96 for valuation, which could be easily manipulated.
Vulnerability Detail
sqrtPriceX96 is the spot price in the pool. The malicious user can dump large amount to manipulate this price. Especially for low liquidity pools, the manipulation can be even easier.
A malicious user can take advantage of the manipulated price, maybe take profit from trading USSD and collaterals in the uniswap pool in control.
Impact
getOwnValuation() could return inaccurate result, and rebalance() function relies on this to trade USSD and collaterals. A malicious user could abuse this to influence the rebalance() and take profit.
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
141345
medium
Spot price in
getOwnValuation()
could be manipulatedSummary
getOwnValuation()
is usinguniPool.slot0()
to get the spot pricesqrtPriceX96
for valuation, which could be easily manipulated.Vulnerability Detail
sqrtPriceX96
is the spot price in the pool. The malicious user can dump large amount to manipulate this price. Especially for low liquidity pools, the manipulation can be even easier.The result is used in
rebalance()
A malicious user can take advantage of the manipulated price, maybe take profit from trading USSD and collaterals in the uniswap pool in control.
Impact
getOwnValuation()
could return inaccurate result, andrebalance()
function relies on this to trade USSD and collaterals. A malicious user could abuse this to influence therebalance()
and take profit.Code Snippet
https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/USSDRebalancer.sol#L71-L80
Tool used
Manual Review
Recommendation
Use TWAP price in
getOwnValuation()
.Duplicate of #451
The text was updated successfully, but these errors were encountered: