Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializer Can be Reinitialized #93

Closed
code423n4 opened this issue Apr 1, 2022 · 1 comment
Closed

Initializer Can be Reinitialized #93

code423n4 opened this issue Apr 1, 2022 · 1 comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")

Comments

@code423n4
Copy link
Contributor

JOYN Contest

April 1, 2022

@securerodd

Findings

Low Risk Findings

1. Initializer Can be Reinitialized

The initializer function in CoreCollection.sol does not contain the onlyUnInitialized() modifier.

Code:

function initialize(
    string memory _collectionName,
    string memory _collectionSymbol,
    string memory _collectionURI,
    uint256 _maxSupply,
    uint256 _mintFee,
    address _payableToken,
    bool _isForSale,
    address _splitFactory
    ) external onlyOwner onlyValidSupply(_maxSupply) {
        _name = _collectionName;
        _symbol = _collectionSymbol;
        _baseUri = _collectionURI;
        maxSupply = _maxSupply;
        mintFee = _mintFee;
        payableToken = IERC20(_payableToken);
        isForSale = _isForSale;
        splitFactory = _splitFactory;
        initialized = true;
    }

The onlyUnInitialized() modifier is currently unused in the code base. In CoreFactory.sol, Core Collections are deployed by an EOA or contract interacting with the Core Factory itself. Without the modifier, these owners have the ability to completely reconfigure key aspects of the collection.

Recommendation:

Apply the onlyUnInitialized() modifier to the initializer function in CoreCollection.sol.

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Apr 1, 2022
code423n4 added a commit that referenced this issue Apr 1, 2022
@sofianeOuafir
Copy link
Collaborator

In my opinion, the severity level should be 3 (High Risk)

duplicate of #4

@sofianeOuafir sofianeOuafir added duplicate This issue or pull request already exists sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity") labels Apr 14, 2022
@deluca-mike deluca-mike added 3 (High Risk) Assets can be stolen/lost/compromised directly and removed QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Apr 22, 2022
@deluca-mike deluca-mike changed the title QA Report Initializer Can be Reinitialized Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) Assets can be stolen/lost/compromised directly bug Something isn't working duplicate This issue or pull request already exists sponsor confirmed Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Projects
None yet
Development

No branches or pull requests

3 participants