Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.7 KB

095.md

File metadata and controls

48 lines (30 loc) · 1.7 KB

Boxy Rouge Eel

High

Flash Loan Exploit in claimIncentives Function of DebitaIncentives.sol

Summary

The DebitaIncentives.sol::claimIncentives is vulnerable to a flash loan exploitAn attacker can manipulate the calculation of rewards (porcentageLent and porcentageBorrow) by temporarily inflating their lentAmount and borrowAmount through a flash loan. This allows the attacker to claim a disproportionately large share of the rewards for an epoch. The vulnerability arises from the absence of key mitigations, such as historical snapshots of balances or lock-in periods, which could prevent transient manipulations of lending and borrowing amounts.

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

A malicious actor can drain a significant portion of the protocol's reward pool, leading to losses for honest users.

PoC

  1. Preparation:
  • Identify the lending and borrowing principles mechanisms that affect lentAmount and borrowAmount.
  • Select a token and an epoch with substantial rewards allocated.
  1. Execution:
  • Use a flash loan to borrow a large amount of the token.
  • Deposit this borrowed amount to inflate lentAmount.
  • Simultaneously, borrow a large amount to inflate borrowAmount.
  1. Exploit:
  • Call the claimIncentives function, leveraging the inflated porcentageLent and porcentageBorrow to claim a disproportionately high share of the epoch's rewards.
  1. Profit: Repay the flash loan, leaving the attacker with the rewards minus the flash loan fee

Mitigation

Require lending and borrowing positions to remain locked for a minimum duration within an epoch to be eligible for rewards.