Incorrect address was used to check whether the variable pool has enough liquidity #285
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
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-06-size/blob/main/src/libraries/CapsLibrary.sol#L67-L72
Vulnerability details
Impact
The critical functions listed below are unlikely to execute successfully, causing the Size protocol to stop working:
buyCreditMarket()
sellCreditMarket()
liquidateWithReplacement()
Proof of Concept
A eligible user (seller) can sell their credit for
szaUSDC
by callingsellCreditMarket()
.sellCreditMarket()
will check if the variable pool has enough liquidity to make sure the seller can redeemszaUSDC
forUSDC
laterly.Size#sellCreditMarket()
:CapsLibrary#validateVariablePoolHasEnoughLiquidity()
:As we all know,
state.data.variablePool
is the AAVE v3 pool, the address of which on Ethereum is 0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2. However, WhenUSDC
token is deposited in AAVE, it will be transferred into itsaToken
address: 0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5cvalidateVariablePoolHasEnoughLiquidity()
used the incorrect address(state.data.variablePool
) to check theunderlyingBorrowToken
balance, resulting in it likely failing to execute successfully. Any functions callingvalidateVariablePoolHasEnoughLiquidity()
to check the variable pool liquidity will revert.Tools Used
Manual review
Recommended Mitigation Steps
Correct the address used for
USDC
balance check:Assessed type
Context
The text was updated successfully, but these errors were encountered: