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
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
ni8mare
medium
Using
slot0
to calculate prices can be manipulated.Summary
Using
slot0
to calculate the token price can be easily manipulated.Vulnerability Detail
The function
getOwnValuation()
inUSSDRebalancer
usesslot0
to calculate price:But,
slot0
returns the most recent data point and hence can be easily manipulated. Please check a similar issue which was reported here.Impact
The function
getOwnValuation
is again used in theSellUSSDBuyCollateral()
andrebalance()
and hence these functions could be manipulated as well.Code Snippet
https://github.com/USSDofficial/ussd-contracts/blob/f44c726371f3152634bcf0a3e630802e39dec49c/contracts/USSDRebalancer.sol#L72
Tool used
Manual Review
Recommendation
To determine the price, use a TWAP instead of
slot0
of uniswapV3pool.Duplicate of #451
The text was updated successfully, but these errors were encountered: