Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

constructor doesn't check if the address is a valid one.

Summary

the constructor does not check if the address of the owner is a valid one, or there is no zero-address check .

Vulnerability Details

The contract initializes the owner in the constructor but doesn't verify that the deployer is the intended owner. This means that anyone deploying the contract becomes the owner, which is a security issue.

Impact

The vulnerability allows anyone to deploy the contract and gain unauthorized ownership, enabling potential data compromise, contract manipulation, and a loss of control over the contract's intended functions.

Tools Used

Manual Analysis

Recommendations

- constructor() {
- s_owner = msg.sender;
- }
+ constructor() {
+ require(msg.sender != address(0), "Invalid owner address");
+ s_owner = msg.sender;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge
almost 2 years ago
inallhonesty Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Admin Input/call validation

Support

FAQs

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