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

zzykxx - Possible griefing attack on lending pools interest rates #187

Closed
sherlock-admin2 opened this issue Feb 16, 2024 · 0 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Feb 16, 2024

zzykxx

medium

Possible griefing attack on lending pools interest rates

Summary

A griefer might be able to have a borrower pay more interest than they should.

Vulnerability Detail

When a lending pool is empty or with little liquidity it's possible to transfer the underlying token directly to it, if this is borrowed the interest rate the borrower has to pay will be higher than it should.

Let's suppose there is an empty lending pool with no or little liquidity, a griefer could do the following:

  1. Griefer adds liquidity to the lending pool via Tranche::deposit()
  2. Wait for Alice to borrow part of the liquidity they provided
  3. Griefer frontruns the borrow by removing their liquidity except some weis and then transfer the amount Alice wants to borrow directly to the lending pool
  4. Alice borrow will succeed but the interest rate will be insanely high because the utilization rate is also high: the debt is big and the pool assumes it only has some weis of liquidity

This attack is mitigated by the following factors:

  1. The interest rate is capped at 2^80 (~= 10^24) because of the downcasting in LendingPool::_calculateInterestRate(). The maximum interest is about 100% every 20 days.
  2. The tokens sent directly to the pool by the griefer are effectively lost and can be transferred to the treasury.
  3. The virtual shares implementation in the tranches might prevent the attacker from collecting all of the interest.

Impact

A borrower might have to pay more interest than they should.

Code Snippet

Tool used

Manual Review

Recommendation

Do not allow to borrow more than the total realised liquidity.

Duplicate of #93

@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 Feb 21, 2024
@sherlock-admin sherlock-admin changed the title Square Pickle Wren - Possible griefing attack on lending pools interest rates zzykxx - Possible griefing attack on lending pools interest rates Feb 28, 2024
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

2 participants