The check for value transfer success is made after the return statement in _withdrawFromYieldPool of LidoVault
The LidoVault contract's _withdrawFromYieldPool function returns before checking whether the value transfer succeeded, so a failed transfer does not revert the transaction. An attacker could withdraw without receiving funds, causing a loss to users.
Submitted by pedroais, also found by 0x52, 0xliumin, cccz, CertoraInc, fatherOfBlocks, GimelSec, hake, hickuphh3, hyh, IllIllI, isamjay, mtz, oyc_109, p4st13r4, peritoflores, rotcivegaf, sorrynotsorry, StErMi, tabish, WatchPug, z3s, 0x4non, 0xf15ers, berndartmueller, dipp, Dravee, MaratCerby, saian, simon135, sseefried, and TerrierLover
Users can lose their funds
Proof of Concept
The code checks transaction success after returning the transfer value and finishing execution. If the call fails the transaction won’t revert since require(sent, Errors.VTCOLLATERALWITHDRAW_INVALID); won’t execute.
Users will have withdrawn without getting their funds back.
Recommended Mitigation Steps
Return the function after the success check
sforman2000 (Sturdy) confirmed
Fix the issue of return before require sturdyfi/code4rena-may-2022#9
Issue is rather clear-cut.
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
The return statement is placed before the require check that verifies the success of the value transfer.
Impact
Users could lose their funds because a failed transfer does not revert, leaving them without their withdrawn amount.
What the attacker needed
None
The fix
The function should perform the success check before returning, so that a failed transfer reverts the transaction.
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, when you send funds, you must check that the send worked. Here, the code sends the funds and then immediately exits the function before checking if the send succeeded. So if the send fails, the contract still thinks the withdrawal is complete, and the user loses their money.
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.