-
Notifications
You must be signed in to change notification settings - Fork 1
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
CoreCollection can be reinitialized #4
Comments
This is a high severity issue and we intend to fix it. The mitigation step looks great and will be considered to fix the issue. In my opinion, the severity level should be 3 (High Risk) instead of 2 (Med Risk) |
And just as I say that, #17 points that out clearly. So, yes, agreed, this is a High Severity issue. |
Lines of code
https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L78-L97
Vulnerability details
Impact
Reinitialization is possible for CoreCollection as
initialize
function setsinitialized
flag, but doesn't control for it, so the function can be rerun multiple times.Such types of issues tend to be critical as all core variables can be reset this way, for example
payableToken
, which provides a way to retrieve all the contract funds.However, setting priority to be medium as
initialize
isonlyOwner
. A run by an external attacker this way is prohibited, but the possibility of owner initiated reset either by mistake or with a malicious intent remains with the same range of system breaking consequences.Proof of Concept
initialize
doesn't control for repetitive runs:https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L87
Recommended Mitigation Steps
Add
onlyUnInitialized
modifier to theinitialize
function:https://github.com/code-423n4/2022-03-joyn/blob/main/core-contracts/contracts/CoreCollection.sol#L46-L49
The text was updated successfully, but these errors were encountered: