Submitted by ChaseTheLight
Note: This finding was reported via the winning Automated Findings report. It was declared out of scope for the audit, but is being included here for completeness.
8, 13
Using the provided modifier onlyOwner for function access control without a proper enforcement mechanism like require or revert is a dire mistake because it fails to restrict access as intended. The modifier merely evaluates a condition (msg.sender == owner) without any action taken based on the result. This means any user, regardless of whether they are the owner, can execute functions that are supposed to be restricted to the owner, potentially leading to unauthorized actions, such as withdrawing funds or altering critical contract settings.
To fix this, the modifier should enforce the ownership check using a require statement:
With this correction, the modifier effectively ensures that only the account designated as owner can access the function. If a non-owner attempts to call the function, the transaction is reverted, maintaining the intended access control and contract integrity.
andresaiello (Curves) confirmed
