Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

Front-Running Vulnerability in Contract Initialization

Summary

The initialize function in LevelOne.sol is vulnerable to front-running attacks as it's publicly callable and lacks proper access control, allowing malicious actors to initialize the contract with their own parameters.

Vulnerability Details

function initialize(address _principal, uint256 _schoolFees, address _usdcAddress) public initializer {
[...]
}
  • Initialize function is marked as public without access restrictions

  • Anyone can call the function and set the initial state

  • Critical parameters like principal, schoolFees, and usdc can be set by anyone

Impact

High: This vulnerability allows:

  • Malicious actors to initialize the contract with their own parameters

  • Potential loss of control over the contract's initial state

  • Possible theft of funds if initialized with malicious addresses

Tools Used

Manual code review

Recommendations

Implement a factory pattern for contract deployment

Updates

Lead Judging Commences

yeahchibyke Lead Judge
30 days ago
yeahchibyke Lead Judge 25 days ago
Submission Judgement Published
Validated
Assigned finding tags:

contract can be re-initialized

The system can be re-initialized by an attacker and its integrity tampered with due to lack of `disableInitializer()`

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.