Closed c4-bot-9 closed 10 months ago
141345 marked the issue as duplicate of #237
0xean marked the issue as satisfactory
0xean removed the grade
0xean marked the issue as unsatisfactory: Insufficient proof
invalid POC
0xean changed the severity to 2 (Med Risk)
Lines of code
https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/modules/PaymentEscrow.sol#L320-L330 https://github.com/re-nft/smart-contracts/blob/3ddd32455a849c3c6dc3c3aad7a33a6c9b44c291/src/policies/Stop.sol#L265-L306
Vulnerability details
if
ESCRW::settlePayment(...)
is called beforeStop.stopRent(...)
for a given Base rental order, funds can be stolen from the escrow preventing other users from stopping their rental leading to loss of funds for lenders and asset stuck in renters safe.Vulnerability Description
This is a different finding I submitted for a reentrancy in the
ESCRW::settlePayment(...)
as this one is a different attack path although a related underlying issuePOC Summary
settlePayment(...)
is an external function that has a wrongly implemented checkSummary
BASE
aliceRentalOrder
with 100 wei, for 500sBASE
`carolRentalOrdercarolRentalOrder with 100 wei, for 500sESCRW
settlePayment(...)
with Alice’saliceRentalOrder
after 200sStop.stopRent(...)
withaliceRentalOrder
, she is settled with another 100 wei and now she has a balance of 200 weiStop.stopRent(...)
withcarolRentalOrder
and it reverts because theESCROW
does not have enough balance to settle Carol and the call reverts.Because
ESCRW::settlePayment(...)
can be called beforeStop.stopRent(...)
is called, it can lead to other lenders being unable to settle their positions leading to a loss of funds from the escrow andthe
_settlePayment(...)
does not remove rentals after settling due payment which in itself will be disastrous if the payment is settled and rentalOrder is removed without settliing assetCODED POC
Add the test case below to the
test/integration/StopRent.t.sol
file and runforge test --mt test_Settle_And_StopRent_BaseOrder -vvv
TOOLS USED
Foundry
RECOMMENDATION
Ensure that
ESCRW.settlePayment(...)
is only callable in the flow of execution ofStop.stopRent(...)
Assessed type
Invalid Validation