Increasing the Lock Amount on an Expired Lock Will Cause Users to Miss Out on Rewards
Increasing the lock amount on an expired lock creates a new lock with the previous lock's bonus ratio, so the user receives no rewards for their active lock. The user must increase the lock duration to fix the bonus ratio.
Submitted by leastwood
HolyPaladinToken.sol#L284-L294 HolyPaladinToken.sol#L1137-L1233
Paladin protocol allows users to increase the amount or duration of their lock while it is stil active. Increasing the amount of an active lock should only increase the total locked amount and it shouldn’t make any changes to the associated bonus ratios as the duration remains unchanged.
However, if a user increases the lock amount on an expired lock, a new lock will be created with the duration of the previous lock and the provided non-zero amount. Because the action != LockAction.INCREASE_AMOUNT check later on in the function does not hold true, userCurrentBonusRatio will contain the last updated value from the previous lock. As a result, the user will not receive any rewards for their active lock and they will need to increase the duration of the lock to fix lock’s bonus ratio.
Recommended Mitigation Steps
Consider preventing users from increasing the amount on an expired lock. This should help to mitigate this issue.
Kogaroshi (Paladin) confirmed, resolved, and commented:
Changes made in this commit: PaladinFinance/Paladin-Tokenomics@b9f7ece. (made in the PR to use the Custom Errors directly)
- added extra tests to make sure this behavior is respected
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 function does not reset the bonus ratio when increasing the amount on an expired lock, because the condition that would normally update it is skipped.
Impact
Users who increase the amount on an expired lock will not receive any rewards for their active lock until they increase the lock duration.
What the attacker needed
User has an expired lock; user increases lock amount
The fix
The issue was fixed by preventing users from increasing the amount on an expired lock, and extra tests were added.
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 user can add more tokens to their locked balance. If they do this after their lock has expired, the system mistakenly keeps the old reward rate, so they earn nothing. They have to extend the lock time to get rewards again.
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.