There is a vulnerability in the function getActivePlayerIndex(address player)
. This vulnerability stems from an incorrect return value when a player is not found in the players
array.
The vulnerability can be found at the last line in the following code snippet:
When the specified player
is not found in the players
array, the function returns a value of 0. This implies that the player is located at the first position of the array, potentially leading to undesired behavior and unintended consequences.
The impact of this vulnerability is significant, as any contract or people utilizing this function may encounter issues. Contracts or people relying on this function to determine the index of a player and perform actions based on that index, such as refunds, will experience transaction reverting.
Manual review.
To address this vulnerability, I recommend updating the code to revert when the specified player
is not found in the players
array.
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.