Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.85 KB

096.md

File metadata and controls

48 lines (30 loc) · 1.85 KB

Boxy Rouge Eel

High

Front-Running Vulnerability in initialize Function of DebitaLendOffer-Implementation.sol

Summary

The initialize function in DebitaLendOffer-Implementation.sol is vulnerable to front-running attacks , it is publicly accessible without proper access control or parameter validation. An attacker can observe an initialization transaction in the mempool and submit their own transaction with manipulated parameters, such as assigning themselves ownership or providing malicious configurations. This allows unauthorized parties to gain control over the contract or disrupt its intended functionality.

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Protocol Disruption: Malicious parameters, such as fake oracle addresses or invalid lending terms, can render the contract dysfunctional.

PoC

  1. Setup
  • The initialize function is publicly accessible and has no restrictions on authorized callers.
  • When the deployer tries to initialize the contract with valid parameters.
  1. Exploit
  • A malicious actor observes the initialization transaction in the mempool.
  • The attacker sends a transaction with higher gas to initialize the contract before the legitimate transaction is mined, using manipulated parameters: _owner: The attacker's address. _oracleID_Principle or _aggregatorContract: A malicious contract address. _apr, _maxLTVs, or other parameters: Arbitrary or harmful values.
  1. Outcome:
  • The attacker’s transaction is mined first, resulting in the contract being initialized with malicious parameters.
  • The legitimate initialization transaction fails due to the contract being already initialized.

Mitigation

Restrict the initialize function so only trusted entities (e.g., the factory contract) can call it.