traceurl - miss updating pool's token balance after finishLiquidation()
The finishLiquidation() function in D3VaultLiquidation.sol fails to update the pool's token balance after a liquidation, causing a mismatch between the recorded balance and the actual token balance. This could lead to serious problems, though the specific exploit is not detailed.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-06-dodo-judging/issues/249
Found by
Protocol Team tracerul
high
Summary
In D3Liquidation's finishLiquidation() function, update pool's token balance is missing.
Vulnerability Detail
Impact
After finishLiquidation, there will be unequally of pool's token balance record and IERC20(token).balanceOf(pool), which will causing serious problems.
Tool Used
Manual Review
Recommandation
Call updateReserveByVault after pool transfer token to vault
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the finishLiquidation() function transfers tokens without calling the internal accounting function to update the pool's recorded reserve balance.
What the attacker needed
None
The fix
The fix is to call updateReserveByVault after the pool transfers tokens to the vault.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a smart contract, the pool keeps a record of how many tokens it holds. When a liquidation finishes, the actual token balance changes, but the record is not updated. This mismatch can cause the pool to behave incorrectly, for example by allowing users to withdraw more than they should.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.