Description:
https://github.com/Cyfrin/2024-11-TwentyOne/blob/a4429168302722d14a5e5996d25d6fc5be22a899/src/TwentyOne.sol#L29
The playersHand function lacks adequate access control, allowing any external entity to retrieve the details of the players hand during the game. This unrestricted access can be exploited by malicious actors to gain an unfair advantage in the game by analyzing the player's cards before making their decisions.
Impact:
Revealing the player's hand to external callers compromises the integrity of the game.
Proof of Concept:
Deploy the contract and start the game.
Call the playersHand function from an external address while the game is ongoing.
Observe the full details of the player's cards being returned without restriction.
Tools Used:
Manual Review.
Recommended Mitigation:
Implement an access control mechanism to restrict access to the playersHand function. Ensure that only the player owning the hand can view the player's cards during the game.
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.