Submitted by AkshaySrivastav, also found by EV_om (1, 2), oakcobalt, SBSecurity, 0xdice91, serial-coder, 0xDING99YA, imare, trachev, J4X (1, 2), rbserver, juancito, evmboi32, hals (1, 2), 0xA5DF, BARW (1, 2, 3, 4, 5), Jorgect, said, 0xAlix2 (1, 2), ZdravkoHr, BI_security, kaden, marqymarq10, rokinot, haxatron, and rvierdiiev
The Guard::updateHookStatus function is designed to allow protocol administrators to manage the status of hooks within the system. Hooks serve as essential components that customize and control flow of transactions within the protocol.
The vulnerability occurs when administrators disable the onStop hook using Guard::updateHookStatus. If the onStop hook gets disabled after a rental is created using that hook then that causes critical disruption in the rental closing flow.
This happens because the hook address is supplied by lender and renter at the time of rental creation, Both onStart and onStop gets executed on that user provided address at rental creation and stoppage respectively. Once a rental gets created its hook address cannot be modified. If the onStop hook gets disabled while the rental was active then the stopRent transaction will always revert.
https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/policies/Stop.sol#L210-L212
This sequence of events can result in situations where rentals cannot be stopped due to the disabling of critical hooks, causing potential issues and disruptions within the protocol.
The assets of lender and ERC20 payments will remain stuck in the renters safe and escrow contract respectively.
Since this bug is dependent upon an admin interaction I am reporting it as medium.
The following foundry test shows the process described above. Add this test case in test/hooks/restricted-selector/RestrictedSelectorHook.t.sol file and run using command forge test --mp test/hooks/restricted-selector/RestrictedSelectorHook.t.sol.
Consider rethinking about the need of onStop hook status because if onStart hook is executed for a rental then the onStop hook must also be executed irrespective of the hook status.
Alec1017 (reNFT) confirmed
reNFT mitigated:
Status: Mitigation confirmed. Full details in reports from juancito and sin1st3r__.
