Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Falendar - offer.maxDeadline is used instead of extendedTime when calculating the fee #1007

Open
sherlock-admin2 opened this issue Nov 25, 2024 · 0 comments

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Nov 25, 2024

Falendar

High

offer.maxDeadline is used instead of extendedTime when calculating the fee

Summary

The feeOfMaxDeadline formula incorrectly uses offer.maxDeadline, which leads to incorrect fee calculations for loan extensions.

Root Cause

Incorrect use of offer.maxDeadline in the fee calculation formula instead of using extendedTime. offer.maxDeadline represents the loan max deadline, while extendedTime represents the loan duration after the loan extension.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Example scenario:

offer.maxDeadline = 10 days
extendedTime = 5 days
feePerDay = 100 units

Using the incorrect formula with offer.maxDeadline:

offer.maxDeadline = 864000 seconds (10 days)
feeOfMaxDeadline = ((864000 * 100) / 86400);
feeOfMaxDeadline = 1000 units

Using the correct formula with extendedTime:

extendedTime = 432000 seconds (5 days)
feeOfMaxDeadline = ((432000 * 100) / 86400);
feeOfMaxDeadline = 500 units

The user would be overcharged by 500 units if the system uses the wrong formula with offer.maxDeadline.

PoC

No response

Mitigation

Use extendedTime instead of offer.maxDeadline when calculating feeOfMaxDeadline.

@sherlock-admin3 sherlock-admin3 changed the title Attractive Currant Kitten - offer.maxDeadline is used instead of extendedTime when calculating the fee Falendar - offer.maxDeadline is used instead of extendedTime when calculating the fee Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant