When users join a special event, they are automatically assigned the producer role, which is recorded in the isProducer mapping
and the producer array
. However, when the stopEvent
function is called to end the event, only the isProducer mapping
is reset, while the producer array is not updated accordingly.
The vulnerability lies in the incomplete removal of producer roles when the stopEvent function is executed. The function correctly resets the isProducer mapping, which tracks whether a user is a producer or not. However, it fails to remove the user from the producer array, which maintains a list of all producers.
This inconsistency can lead to several issues:
Stale Data: The producer array will contain outdated information, as it will still include users who are no longer producers after the event has ended.
Incorrect Producer Count: The length of the producer array will not accurately reflect the current number of active producers, as it will include users who have been removed from the isProducer mapping..
Potential Privilege Escalation: If the producer array is used for any privileged operations or access control, users who are no longer producers according to the isProducer mapping may still be able to perform actions reserved for producers.
The impact of this vulnerability depends on how the producer array is used within the smart contract and any associated systems. Potential consequences include:
Data Inconsistency: The presence of stale data in the producer array can lead to confusion and incorrect assumptions about the current state of producers.
Incorrect Calculations: If the producer array is used for any calculations or metrics, the results may be inaccurate due to the inclusion of users who are no longer producers.
Unauthorized Access: If the producer array is used for access control or privileged operations, users who are no longer producers according to the isProducer mapping may still be able to perform actions they should not have access to.
The joinEvent calls the add _addProducer function
Manual Review, Foundry
All users in the special event should be removed from the producers array in the stopEvent function.
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.