Wrong calculation on _collectRentAction
The smart contract function `_collectRentAction` incorrectly calculates a refund time using the current block timestamp instead of the user's foreclosure time. This miscalculation could allow an attacker to drain funds.
*Submitted by a*dlamo_
The method _collectRentAction contains the following code:
in case 6, it is doing:
_refundTime = block.timestamp - marketLockingTime;
instead of:
_refundTime = _timeUserForeclosed - marketLockingTime;
This could lead to funds being drained by the miscalculation.
mcplums (Reality Cards) commented:
This is a really great find!!
Splidge (Reality Cards) confirmed and resolved:
Fix implemented here
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the code used `block.timestamp` instead of the stored `_timeUserForeclosed` variable when computing `_refundTime`.
What the attacker needed
None
The fix
The issue was fixed by the project team.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract had a bug in how it calculated a refund time. It used the current time instead of the time when a user was foreclosed, which could let someone take more money than they should.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.