The Last Man Standing game has a minor vulnerability in its claimThrone()
function where there is no validation or notification for excess ETH sent by users. If a player sends more ETH than the required claim fee, the excess amount is silently added to the pot without any notification to the user.
When a player sends more ETH than the required claim fee, the contract should either:
Return the excess ETH to the sender, or
Clearly notify the user that the excess amount will be added to the pot
The contract silently accepts any excess ETH and adds it to the pot without notifying the user. This could lead to users accidentally overpaying without realizing it.
The vulnerability exists in the claimThrone()
function where it only checks if the sent amount is greater than or equal to the required fee, but doesn't handle excess amounts:
The function uses >=
in the require statement, allowing for excess ETH, but doesn't provide any mechanism to handle or notify about the excess amount.
The impact is low because:
It doesn't affect the core functionality of the contract
The excess ETH isn't lost (it goes to the pot)
Users can still participate in the game as intended
The likelihood is medium because:
Users might not always send the exact claim fee amount
The UI might not enforce exact payments
Users might intentionally send more to increase the pot
The issue can be verified by examining the claimThrone()
function in Game.sol. There is no mechanism to handle or notify about excess ETH sent by users.
Add a check for excess ETH and emit an event to notify the user:
The fix adds a check for excess ETH and emits an event to notify the user when they send more than the required claim fee. This improves transparency and user experience without changing the core functionality of the contract.
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.