Closed sherlock-admin2 closed 1 year ago
4 comment(s) were left on this issue during the judging contest.
shogoki commented:
Tokens are whitelisted
0xyPhilic commented:
invalid because it is irrelevant considering that only whitelisted tokens will be supported accross the protocol
darkart commented:
Invalid
Kral01 commented:
only whitelisted tokens are used in the protocol
pks_
high
Malicious token creator can change token decimals to make token price abnormally and cause contract asset stolen
Summary
IchiVaultOracle#getPrice use
t0Decimal
andt1Decimal
to calculatetotalReserve
and token price. However,t0Decimal
andt1Decimal
can be manipulated by malicious token creators. So it's vulnerable when token decimals change and the token price may inflate or deflate, which will cause contract assets stolen.Vulnerability Detail
and
Impact
The contract assets may be stolen by malicious token creators.
Code Snippet
https://github.com/sherlock-audit/2023-07-blueberry/blob/main/blueberry-core/contracts/oracle/IchiVaultOracle.sol#L124-L152 https://github.com/sherlock-audit/2023-07-blueberry/blob/main/blueberry-core/contracts/oracle/UniswapV2Oracle.sol#L40-L57
Tool used
vscode, Manual Review
Recommendation
Use cache mechanism to cache token decimals to prevent token decimal changed.
reference: https://github.com/sherlock-audit/2023-06-bond-judging/issues/90