Submitted by Ch_301, also found by nnez
https://github.com/code-423n4/2024-10-coded-estate/blob/main/contracts/codedestate/src/execute.rs#L1490-L1541
https://github.com/code-423n4/2024-10-coded-estate/blob/main/contracts/codedestate/src/execute.rs#L1786-L1854
Due to the long period of the long-term rent, the Homeowner has an advantage in that type of reservation, which is the ability to withdraw a part from the deposited amount by the tenant. This applies only to reservations made more than one month in advance. This could be done by using execute.rs#withdrawtolandlord() function.
The withdrawn amount will be subtracted from the users deposit_amount state:
On the other side, the NFT owner can trigger execute.rs#rejectreservationforlongterm() to reject any reservation at any time even if it currently running, it will send back .deposit_amount as a refundable amount to the user.
However, a malicious homeowner can the advantages of execute.rs#rejectreservationforlongterm() and execute.rs#withdrawtolandlord() to steal a users funds and reject them in two simple steps:
Note: The homeowner has the power to reject any reservation even if it is currently active by triggering rejectreservationforlongterm() and refunding user money; however, using this function, the refundable amount is the same initial deposit.
Dont allow to reject active reservations.
blockchainstar12 (Coded Estate) acknowledged and commented:
