Initializers can be front-run
Closed this issue · 3 comments
weed0607 commented
Initializers could be front-run, allowing an attacker to either set their own values, take ownership of the contract, and in the best case forcing a re-deployment.
There are two instances of these problems
File: contract/MCV2_Token.sol
23: function init(string calldata name_, string calldata symbol_) external {
File: contract/MCV2_MultiToken.sol
37: function init(string calldata name_, string calldata symbol_, string calldata uri_) external {
0x3agle commented
- That would have been true if the
deployment
andinitialization
happened in two separate transactions. - In here, both are happening in a single transaction:
MCV2_Token newToken = MCV2_Token(token); //deployment
newToken.init(tp.name, tp.symbol); //initialization
- Hence, this scenario is not possible.
sydneyitguy commented
I agree with @0x3agle
weed0607 commented
I only checked the deployment test.
In the test, there was not immediate initialization.
Sorry, I think this one is invalid one, again