Rock Paper Scissors

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

Title: Admin Can Reassign Themselves Repeatedly

Description: Lack of check allows admin to call setAdmin() with their own address, leading to potential gas griefing or governance stagnation.

Summary:

The setAdmin() function lacks a condition to prevent the current admin from reassigning themselves. This introduces a pointless state change that could be exploited for griefing or accidental misuse.

Vulnerability Details:

function setAdmin(address _newAdmin) external {

require(msg.sender == adminAddress, "Only admin can set new admin");

require(_newAdmin != address(0), "Admin cannot be zero address");

adminAddress = _newAdmin;

}

There’s no require(_newAdmin != adminAddress) check.

This allows the current admin to reassign themselves repeatedly.

Could be abused to fill blocks with unnecessary gas consumption.

Impact:

Medium severity (DoS/gas griefing vector, no loss of funds but direct disruption of protocol integrity).

Prevents transparent admin rotation.

Tools Used:

Manual review.

Recommendations:

Add an explicit check to ensure the new admin is different from the current one:

require(_newAdmin != adminAddress, "Admin is already assigned");

Updates

Appeal created

m3dython Lead Judge about 2 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.

m3dython Lead Judge about 2 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.