The get_players function in the provided Vyper contract contains a potential lack of input validation vulnerability. This vulnerability arises due to the absence of a check to ensure that the index provided is within the bounds of the players array.
In the get_players function, there’s no check to ensure that the index provided is within the bounds of the players array. This could lead to a runtime exception if an out-of-bounds index is provided.
If exploited, this vulnerability could lead to unexpected behavior of the contract. An out-of-bounds error could cause the contract to revert, disrupting its normal operation and potentially leading to a denial of service.
Remix
To mitigate this vulnerability, you could add a check to ensure the index is valid before accessing the players array. Refactoring of code is in the github link.
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.