Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

[L-2] Inconsistent Access Control: NatSpec Labels setJoinTimeout as Admin Function but Restricts to Owner

Summary

The RockPaperScissors::setJoinTimeout function is documented as an "admin function" in its NatSpec comment. The documentation(readme) also states that only an admin can update timeout. However, the function restricts access using require(msg.sender == owner()), indicating that only the contract owner can call it.

Vulnerability Details

/**
* @notice Set the join timeout period (admin function)
* @param _newTimeout New timeout value in seconds
*/
function setJoinTimeout(uint256 _newTimeout) external {
require(msg.sender == owner(), "Only owner can set timeout");
...
}

The @notice tag describes the function as an "admin function", which usually implies it is callable by a designated admin i.e. adminAddress . This discrepancy may lead to misunderstandings about who is authorized to execute this function.

Impact

  • Potential misunderstanding of access control roles.

  • Could lead to incorrect assumptions about who has the authority to call the function.

Tools Used

Manual Review

Recommendations

There's a need for clarity on the roles each actor can perform. This needs to be consistent from the documentation to the natspec.

Updates

Appeal created

m3dython Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational

Code suggestions or observations that do not pose a direct security risk.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!