contract Vether4 function _recordBurn first does all the calculations and only at the end calls _updateEmission(). This means that in theory last user still contributes to the previous day even though this day has already passed. So it is possible to write a custom smart contract that does all these actions in one tx:
1) burns ether (catch the moment when the time passed the next day time but is not yet recorded by _updateEmission).
2) withdrawShare (_updateEmission is already called and the day has shifted).
3) sells the acquired VETHER for ETH on AMM for profit or reverts.
Recommended Mitigation Steps
Always call _updateEmission first or even better, extract it to a modifier which you can put in front of the function.
Handle
paulius.eth
Vulnerability details
Impact
contract Vether4 function _recordBurn first does all the calculations and only at the end calls _updateEmission(). This means that in theory last user still contributes to the previous day even though this day has already passed. So it is possible to write a custom smart contract that does all these actions in one tx: 1) burns ether (catch the moment when the time passed the next day time but is not yet recorded by _updateEmission). 2) withdrawShare (_updateEmission is already called and the day has shifted). 3) sells the acquired VETHER for ETH on AMM for profit or reverts.
Recommended Mitigation Steps
Always call _updateEmission first or even better, extract it to a modifier which you can put in front of the function.