Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Implicit Ownership Assignment-Unauthorized Access Risk

Summary

This vulnerability arises from the implicit assignment of the contract's ownership to the deploying address, due to inheriting from OpenZeppelin's Ownable contracts, without explicitly setting the owner in the constructor. This implicit behavior could lead to unauthorized access and control over owner-only functions if not properly managed.

Vulnerability Details

In Solidity and the Ethereum smart contract ecosystem, the Ownable contract is a common pattern used to restrict access to certain functions to only the owner of the contract. The Ownable contract from OpenZeppelin assigns the ownership to the deployer of the contract by default. In the case of the PuppyRaffle contract, since it inherits from Ownable, this behavior is inherited as well. However, there is no explicit setting of the owner in the constructor, which could lead to potential mishandlings of contract ownership.

Impact

Unauthorized Access: If the deployer of the contract is not supposed to retain ownership, or if there is a need to change ownership right after deployment, the implicit setting of the owner could lead to unauthorized access and control over owner-only functions.

Lack of Clarity: Future developers or auditors might not be aware of who the owner is supposed to be, as it is not clearly set or documented in the contract, leading to potential security risks.

Insecure Deployment Practices: If the contract is deployed through an intermediary or a deployment script, the ownership might be unintentionally assigned to an undesired address, creating a vulnerability.

Tools Used

Recommendations

Explicitly set the owner of the contract in the constructor.

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 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.

Give us feedback!