Due to a missing check in Laundrette::quiteTheGang
, any gang member is allowed to remove any other gang member. Gang members should only be able to remove themselves. The only account that is allowed to remove other gang members should be the godfather.
The function Laundrette::quitTheGang
allows for revoking the gangmember
role from accounts. This function can be called by any other gang member as ensured by the onlyRole
modifier:
While it makes sense for individual gang members to remove themselves from the system by calling Laundrette::quitTheGang
with their own account as account
parameter, it should not be possible to remove any other gang member.
If at all, only the godfather should be allowed to remove the role from accounts other than his own.
Gang members that are eligible to receive weapens from the WeaponShelf
will be unable to withdraw their weapons via Laundrette::takeGuns
, if any other gang member removed their role.
This breaks a core purpose of the protocol.
Another scenario is that an account front-runs any call made by the godfather to Laundrette::addToTheGang
and remove his gangmember
role, preventing him from adding new members to the gang. This is actually a bug of itself covered in a different report, this function should not require the godfather to be a gang member in the first place. However, if for whatever reason that bug is not addressed, then this remains a problem.
Manual review
Foundry for testing
To ensure only the godfather can remove other gang members, and gang members can only remove themselves, we can make use of the already existing isAuthorizedOrRevert
modifier in combination with the onlyRole
modifier, similar to how it's done in Laundrette::takeGuns
:
Below is a test that shows how an arbitrary gang member can remove the gangmember
role from any other gang member. It can be dropped right into Laundrette.t.sol
.
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.