code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

It is possible to "uninitialize" `ERC20Facet` contract #276

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Czar102

Vulnerability details

Impact

The initialization status is defined by the name and symbol. It is possible it set them back to an empty string, uninitializing the contract and letting the initialize(..) function be called again. This way, the owner may, for example, hide minting additional tokens. Or, after accidentally setting name and symbol to empty strings, anyone can take control over the contract and mint any number of tokens.

In general, it shouldn't be possible to initialize more than once.

Tools Used

Manual analysis

Recommended Mitigation Steps

Consider adding empty string checks in setName(...) and setSymbol(...) functions.