Malicious homeowners can rug #31
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-2
🤖_primary
AI based primary recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2024-10-coded-estate/blob/main/contracts/codedestate/src/execute.rs#L523-L541
Vulnerability details
Description
Homeowners can trigger
burn()
(CW_721) fromexecute.rs
file.They can pass the
token_id
and burn it without checking if the homeowner has ongoing rent or any reservations.So, a malicious homeowner can rug his customers which will lead the travelers with approved/non-approved rent will lose their deposit.
By triggering
execute.rs#burn()
at any time.Impact
Tools Used
Manual Review
Recommended Mitigation Steps
call
check_can_edit_long()
orcheck_can_edit_short()
(currently are the same thing) to check if therentals
is empty or no active rent/reservationFile: execute.rs#burn() fn burn( &self, deps: DepsMut, env: Env, info: MessageInfo, token_id: String, ) -> Result<Response<C>, ContractError> { let token = self.tokens.load(deps.storage, &token_id)?; self.check_can_send(deps.as_ref(), &env, &info, &token)?; + self.check_can_edit_short(&env, &token)?;
Assessed type
Rug-Pull
The text was updated successfully, but these errors were encountered: