In the joinDAO
function, the tier full validation may not be properly enforced, potentially allowing users to join a tier even if it is full, leading to incorrect behavior.
The issue arises from the line:
This validation checks if the number of members in the selected tier exceeds the tier's capacity. However, if the minted
value is not correctly updated or if there are race conditions in the contract execution, this validation could fail to prevent additional users from joining a full tier.
This breaks the security guarantee of proper membership control, which is critical for ensuring that tiers do not exceed their capacity, potentially leading to issues like users being minted more tokens than allowed, or more than the intended number of members in a tier.
A malicious actor could repeatedly call joinDAO
for a tier that they believe is not full (due to inconsistent state updates).
If the state variable minted
is not correctly updated after each mint or is manipulated via reentrancy, users may be able to mint additional tokens beyond the tier's defined capacity, leading to over-minting and the potential abuse of the membership system.
Location: MembershipFactory.sol
, joinDAO
function.
Security Impact: The tier's full capacity check is bypassed under specific conditions (inconsistent state updates).
Type: Race Condition / State Inconsistency — When minted
is not correctly updated or is delayed, malicious actors can exploit this window to bypass full tier validation.
This vulnerability can allow users to mint more tokens than intended, violating the designed membership limits of the DAO. If users are able to bypass the tier limit, it may lead to unexpected behaviors like excessive token distribution, violation of DAO rules, and even financial loss in a DAO context.
Critical: This issue could lead to the issuance of more tokens than intended and break tier membership controls.
Exploitability: This issue could be exploited by attackers that are aware of the timing or state inconsistencies.
Deploy the contract and create a DAO with multiple tiers.
Attempt to join a full tier by calling the joinDAO
function multiple times.
Observe that if the minted
count is not updated correctly, the user may still be allowed to mint additional tokens even if the tier is full.
Example of potentially faulty input:
To fix this issue, ensure that the minted
value is properly updated in a consistent manner. Consider using a reentrancy guard or mutex to prevent multiple state-changing operations from occurring simultaneously. Additionally, include an additional check to verify that the tier is indeed full before minting.
Alternatively, a mutex to prevent reentrancy could be added:
The bug can be resolved by ensuring that the minted
count is updated consistently and is protected from race conditions. Implementing a mutex or other mechanisms to ensure state consistency during critical updates is a vital step in fixing this issue.
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.