Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

No Access Control for Principal

Summary
Anyone can initialize the contract and set themselves as the principal.

Vulnerability Details
Root Cause: The initialize function does not restrict who can set the principal:

principal = _principal;

Initial State: The contract is deployed.

Step 1: An unauthorized user initializes the contract.

Outcome: The unauthorized user becomes the principal.

Implications: The contract can be drained or misused.

Impact
Who is affected: The school system.

How they are affected: Unauthorized access could lead to loss of funds.

Tools Used
manuel review

Recommendations
Restrict initialization to the deployer:

require(msg.sender == deployer, "Not authorized");

Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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