Therefore, the precision of Collateral is the same as that of UnderlyingToken, and the precision of each UnderlyingTokens may be different. Direct addition will lose some UnderlyingTokens with less precision
Proof of Concept
Attackers can exploit this issue to liquidate healthy positions
Tools Used
manual
Recommended Mitigation Steps
Consider the case where UnderlyingTokens have different precision
Lines of code
https://github.com/code-423n4/2023-05-venus/blob/main/contracts/Comptroller.sol#L1331
Vulnerability details
Impact
Suppose
exchangeRate = uTokenBalance / vTokenBalance
:Therefore, the precision of Collateral is the same as that of UnderlyingToken, and the precision of each UnderlyingTokens may be different. Direct addition will lose some UnderlyingTokens with less precision
Proof of Concept
Attackers can exploit this issue to liquidate healthy positions
Tools Used
manual
Recommended Mitigation Steps
Consider the case where UnderlyingTokens have different precision
Assessed type
Decimal