The deployment script includes a critical flaw because the godFather was not assigned the gang member role, the godFather is expected to add new gang members. However, the addToTheGang function requires the user calling the function to be the godFather and have a gangMember role. This issue can render the contract unusable because the godFather cannot add new gang members without first being assigned the gangMember role. There is no godFather without gang member.
The godFather is the user meant to oversee and manage the addition of new gang members. During deployment, gang member role is not granted to the godFather, but the Laundrette
contract’s function addToTheGang requires the caller to be the godFather and have a gangMember role to add new members. This requirement is logically flawed because it prevents the godFather from performing their primary function without already having a role that only they can assign.
Vulnerability Details:
Location: addToTheGang function
Issue: The addToTheGang function checks if the caller has both godFather and gangMember roles. Since the godFather role is not granted the gangMember role, the godFather cannot fulfill their role of adding new gang members.
Type: Logical flaw in role assignment and access control
This vulnerability can lead to the following issues:
Functionality Lockout: The godFather cannot add new gang members, effectively preventing the use of the contract for its intended purpose.
Operational Halt: Without the ability to add new members, the contract’s operation comes to a standstill, impacting all potential functionalities relying on the addition of gang members.
The deployment script is deployed by owner, and it does not assign a gang member role to the godfather
The god father tries to add a gang member and the function reverted
Manual Review
Recommendations:
Initial Role Assignment:
Ensure that during deployment, the godFather is granted the gangMember role.
Alternatively, remove the requirement for the godFather to have the gangMember role in the addToTheGang function.
Test the add gang menber function again, it will pass now.
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.