Skip to content
This repository has been archived by the owner on Mar 3, 2024. It is now read-only.

deadrxsezzz - Lender can front-run rollLoan and call provideNewTermsForRoll with unfavorable terms #243

Open
sherlock-admin2 opened this issue Aug 28, 2023 · 3 comments
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A valid Medium severity issue Reward A payout will be made for this issue Will Fix The sponsor confirmed this issue will be fixed

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Aug 28, 2023

deadrxsezzz

high

Lender can front-run rollLoan and call provideNewTermsForRoll with unfavorable terms

Summary

Lender can front-run rollLoan and result in borrower accepting unfavorable terms.

Vulnerability Detail

After a loan is created, the lender can provide new loan terms via provideNewTermsForRoll. If they are reasonable, the user can then accept them. However this opens up a risky scenario:

  1. User A borrows from lender B
  2. Lender B proposes new suitable terms
  3. User A sees them and calls rollLoan to accept them
  4. Lender B is waiting for this and sees the pending transaction in the mempool
  5. Lender B front-runs user A's transaction and makes a new call to provideNewTermsForRoll will an extremely high interest rate
  6. User A's transaction now executes and they've accepted unfavorable terms with extremely high interest rate

Impact

User may get mislead in to accepting unfavorable terms and overpaying interest

Code Snippet

https://github.com/sherlock-audit/2023-08-cooler/blob/main/Cooler/src/Cooler.sol#L192
https://github.com/sherlock-audit/2023-08-cooler/blob/main/Cooler/src/Cooler.sol#L282

Tool used

Manual Review

Recommendation

When calling rollLoan let the user pass a parameter consisting of the max interest rate they are willing to accept to prevent from such incidents.

@github-actions github-actions bot closed this as completed Sep 1, 2023
@github-actions github-actions bot added Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Sep 1, 2023
@sherlock-admin sherlock-admin changed the title Generous Juniper Mink - Lender can front-run rollLoan and call provideNewTermsForRoll with unfavorable terms deadrxsezzz - Lender can front-run rollLoan and call provideNewTermsForRoll with unfavorable terms Sep 12, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Sep 12, 2023
@hrishibhat hrishibhat reopened this Sep 18, 2023
@hrishibhat hrishibhat added Has Duplicates A valid issue with 1+ other issues describing the same vulnerability and removed Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label labels Sep 18, 2023
@0xrusowsky 0xrusowsky added the Will Fix The sponsor confirmed this issue will be fixed label Sep 18, 2023
@0xrusowsky
Copy link

@jkoppel
Copy link
Collaborator

jkoppel commented Sep 20, 2023

This is moot because rollLoan no longer exists.

@MLON33
Copy link

MLON33 commented Sep 21, 2023

From @0xrusowsky: Cooler says the fix for this issue has been validated by @jkoppel. The protocol team acknowledges this issue: “...he (@jkoppel) validated it afterwards in discord and another issue (#119).”

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A valid Medium severity issue Reward A payout will be made for this issue Will Fix The sponsor confirmed this issue will be fixed
Projects
None yet
Development

No branches or pull requests

6 participants