A critical vulnerability exists in the claimThrone()
function due to an incorrect comparison operator. The function uses ==
instead of !=
when checking if the sender is already the current king, preventing anyone from claiming the throne and effectively breaking the core game functionality.
The vulnerability is located in claimThrone()
function:
This logic is inverted. The function should prevent the current king from re-claiming the throne, but instead it prevents anyone who is NOT the current king from claiming it.
If msg.sender
is the current king → requirement passes → function continues
If msg.sender
is NOT the current king → requirement fails → transaction reverts
If msg.sender
is the current king → requirement fails → transaction reverts with appropriate message
If msg.sender
is NOT the current king → requirement passes → function continues
Complete Game Breakdown: The core functionality of the game is completely broken. No player can claim the throne except potentially the initial king which is address(0)
.
Financial Loss: Players who attempt to claim the throne will have their transactions fail, wasting gas fees.
Contract Becomes Unusable: The primary purpose of the contract (throne claiming mechanism) is non-functional.
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.