Open c4-bot-4 opened 10 months ago
141345 marked the issue as primary issue
141345 marked the issue as sufficient quality report
Alec1017 (sponsor) confirmed
As a mitigation for this, we will not deploy with a version that uses checkModuleTransaction
, we will use v1.3
I believe this to be QA as it is about future versions and future proofing vs current vulnerabilities.
0xean changed the severity to QA (Quality Assurance)
0xean marked the issue as grade-b
0xean marked the issue as grade-a
Lines of code
https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/policies/Stop.sol#L265 https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/policies/Stop.sol#L166
Vulnerability details
M-Failure-to-stop-and-settle-rental-if-genosis-safe-wallet-is-v1.50-or-later
Proof of concept
this report is inspired by
Reference to
c4-submissions
reportafter the rental expires, anyone can call stopRent
the first step is transfer the NFT back. Line of code
and this is calling _reclaimRentedItems
and this is calling execTransactionFromModule
if the safe wallet is create via safe wallet proxy v1.5.0+,
the guard is already set when the safe wallet is deployed
so the code would trigger the check
checkModuleTransaction
Impact
but in the guard contract, there is no such function (checkModuleTransaction) implemented
Reference
so
Guard(guard).checkModuleTransaction
will revertand
execTransactionFromModule
revert andstopRent
revertthe guard smart contract is not upgradeable,
and in the current guard function, the owner cannot set a new guard because of the check always make the set guard revert
Line of code
so the impact is if the safe wallet v.1.5.0 is used, no one can call stopRent to settle the rental, and lender lose their nft and lender or renter lose the rental payment.
why protocol support safe wallet v.1.5.0?
Reference on deployed blockchain
the protocol does not mention which safe wallet will the code support
the dependency for safe wallet does not lock the version to v.1.4 as well, it is whatever the code in the safe master contract
so once the safe wallet v.1.5.0 PR is merged and the safe wallet v.1.5.0 is released, it is possible that the code support safe v.1.5.0
the relevant safe wallet PR is here: https://github.com/safe-global/safe-contracts/pull/571
Recommendation
only allow safe owner to whitelist the guard contract that is whitelisted or make the guard contract upgradeable.
Assessed type
Other