Before current update, Vault had exchange rate that was stored as separate variable. Vault.liquidate function has _amountOut param, which was used such as exchange rate is always 1. The same value was used as asset amount and as shares amount without any conversion. Because of that liquidate function worked not as expected.
Solution
Now, Vault doesn't have any exchange rate in case if it's collateralized. Vault.liquidate function can be called only when vault is collateralized, which means that in such case exchange rate is 1:1. Because of that, it's now correct to use _amountOut function same for assets and for shares. As result, issue has gone.
Lines of code
Vulnerability details
Issue mitigated
About the problem
Before current update, Vault had exchange rate that was stored as separate variable.
Vault.liquidate
function has_amountOut
param, which was used such as exchange rate is always 1. The same value was used as asset amount and as shares amount without any conversion. Because of thatliquidate
function worked not as expected.Solution
Now, Vault doesn't have any exchange rate in case if it's collateralized.
Vault.liquidate
function can be called only when vault is collateralized, which means that in such case exchange rate is 1:1. Because of that, it's now correct to use_amountOut
function same for assets and for shares. As result, issue has gone.