Protocol is not usable due to incorrect aaveV3 liquidity check #114
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-218
🤖_10_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-06-size/blob/8850e25fb088898e9cf86f9be1c401ad155bea86/src/Size.sol#L178
https://github.com/code-423n4/2024-06-size/blob/8850e25fb088898e9cf86f9be1c401ad155bea86/src/Size.sol#L188
https://github.com/code-423n4/2024-06-size/blob/8850e25fb088898e9cf86f9be1c401ad155bea86/src/Size.sol#L229
Vulnerability details
Impact
Protocol checks the current liquidity of the underlying borrow token in aaveV3 pool in
buyCreditMarket()
,sellCreditMarket()
andliquidateWithReplacement()
. The check gets the balance of an incorrect address (the variable pool) which does not hold any funds. This causes a revert every time any of these 3 functions are called.Proof of Concept
Inside variablePool.supply() function inside AaveV3 code (that can be inspected via etherscan
here
) we can see that the funds are actually transferred immediately to the aTokenAddress:The check will revert every time since the balance of variable pool is going to be 0.
Link to code:
link
Tools Used
Manual Review
Recommended Mitigation Steps
Use the aToken address to check what is the current liquidity:
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: