Last Man Standing

First Flight #45
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Unrestricted Parameter Changes by Owner

Root + Impact

Description

  • The owner is meant to adjust game parameters only between rounds, ensuring that ongoing rounds are not unfairly influenced.

  • In the current code, the owner can change parameters (such as gracePeriod, initialClaimFee, etc.) at any time, including during active rounds. This undermines fairness and can lead to manipulative game outcomes.

function updateGracePeriod(uint256 _newGracePeriod) external onlyOwner {
require(_newGracePeriod > 0, "Game: New grace period must be greater than zero.");
@> gracePeriod = _newGracePeriod; <@
emit GracePeriodUpdated(_newGracePeriod);
}

Risk

Likelihood:

  • This occurs anytime the owner chooses to change parameters during a live round.

  • There are no guards preventing mid-game manipulation.

Impact:

  • The owner can end the game early (e.g., by shortening the grace period).

  • Players may lose trust in the fairness and transparency of the game.

Proof of Concept

// gracePeriod can be changed mid-game
function updateGracePeriod(uint256 _newGracePeriod) external onlyOwner {
gracePeriod = _newGracePeriod;
}

Explanation:
No check ensures that updates only happen when the game is ended. The owner can change critical game dynamics during a round, potentially for personal gain or to alter outcomes.

Recommended Mitigation

- function updateGracePeriod(uint256 _newGracePeriod) external onlyOwner {
+ function updateGracePeriod(uint256 _newGracePeriod) external onlyOwner gameEndedOnly {

Mitigation Explanation:
By applying the gameEndedOnly modifier to parameter update functions, changes are allowed only between rounds, preserving fairness and preventing manipulation.

Updates

Appeal created

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.