There is a logical inconsistency in the handling of the whitelist flag during contract initialization. If the whitelist flag is set to false by default, the initialize() function should explicitly set the whitelist flag to false to align with the intended contract design. Conversely, if the whitelist flag is intended to be true upon initialization, the initialize() function should ensure it is set to true. This issue could lead to improper flag settings during contract upgrades or reinitializations, potentially allowing unauthorized access or actions.
If by design the whitelist enabled flag is set to false on initialization, the initialize() function should set the whitelist flag to false. This is because the contract is an upgradeable contract and the owner can change the whitelist flag to true at any time, When the contract is upgraded, and initialized again, the whitelist flag will remain true if it was set to true before the upgrade.
This violates the design of the contract, as the whitelist flag should be set to false on initialization.
On the other hand, if the whitelist flag is set to true on initialization, the initialize() function should set the whitelist flag to true, because on the first deployment, the whitelist flag will be set to false by default, and remain the same unless the owner changes it.
Locations:
The probability of this issue occurring is low, but the impact is high. If the whitelist flag is not correctly set during initialization, it could result in improper access control or authorization issues, especially after contract upgrades.
Manual code review
if the whitelist flag is set to false on initialization, set the whitelist flag to false in the initialize() function.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.