Closed sherlock-admin3 closed 2 months ago
Will fix
Escalate
This issue is a low as the edition can be set later in setEditionImplementation().
Escalate
This issue is a low as the edition can be set later in setEditionImplementation().
You've created a valid escalation!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Agree with the escalation, planning to accept it and invalidate the report.
Result: Invalid Has Duplicates
The protocol team fixed this issue in the following PRs/commits: https://github.com/titlesnyc/wallflower-contract-v2/pull/1
xiaoming90
medium
Edition implementation not initialized on proxy
Summary
Edition implementation is not initialized on the proxy. As a result, the ability to create an edition, which is a core functionality of the protocol, is broken.
Vulnerability Detail
The
TitlesCore
is the logic/implementation contract behind the ERC1967 proxy. The protocol adopts the UUPS proxy design.It was observed that there is an issue at Line 37 below. When using a proxy contract, any direct initialization of state variables in the implementation contract (like
address public editionImplementation = address(new Edition());
directly in the field declaration) only affects the storage layout at the implementation level during deployment and does not affect the proxy’s state.As a result, on the proxy itself, the
editionImplementation
will remain uninitialized, which is default to the0x0000000000000000000000000000000000000000
(the zero address).https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/TitlesCore.sol#L37
When someone creates a new Edition, the Edition contract will be cloned from the
editionImplementation
as shown at Line 79 below. Since theeditionImplementation
is not initialized, the clone will fail and revert. As a result, users will not be able to create an edition.https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/TitlesCore.sol#L79
Impact
Creating an edition is a core functionality of the protocol and this function is broken.
Code Snippet
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/TitlesCore.sol#L37
https://github.com/sherlock-audit/2024-04-titles/blob/main/wallflower-contract-v2/src/TitlesCore.sol#L79
Tool used
Manual Review
Recommendation
Consider the following changes to ensure that the
editionImplementation
is initialized properly on the proxy.