The contract allows the owner to update the values of gracePeriod
and initialClaimFee
through update functions.
However, the setter functions do not enforce any maximum bounds, which can result in extremely high values being set either intentionally or by accident.
This breaks the intended game design where the throne should be regularly contestable with reasonable fees and timeframes.
Impact High:
Players may be priced out from claiming the throne due to prohibitive fees.
The game could become unclaimable for extended periods, breaking competition.
Such misconfigurations reduce trust and fairness in gameplay.
Likelihood Medium:
This will occur when the contract owner (or a compromised owner account) sets gracePeriod
to a very high value, e.g., 365 days
or more.
Similarly, setting initialClaimFee
to an excessively high number (e.g., 100 ether
) would make it financially inaccessible for most users.
This is especially likely during maintenance, updates, or manual parameter adjustments when bounds are not enforced.
minimal test demonstrating the flaw:
This shows that the game parameters can be configured to absurd levels, harming the playability of the contract.
To prevent denial-of-service scenarios or configuration misuse caused by unbounded parameter updates, it is recommended to enforce strict upper bounds on both gracePeriod
and initialClaimFee
. This ensures the contract cannot be rendered unusable due to excessive values and aligns with best practices in smart contract governance.
This following changes implement hard-coded safety limits using constants, and apply require()
checks inside the update functions:
Prevents Configuration Abuse: Limits the risk of the owner accidentally or maliciously locking out users.
Ensures Protocol Availability: Guarantees that users will always be able to participate in the throne claiming process.
Improves Security Posture: Avoids introducing infinite loop potential or extreme economic disincentives (e.g., claim fees of 1000 ETH).
Best Practice: Parameter bounding is a common industry practice for upgradable and governed contracts.
If additional flexibility is desired, these limits can be made adjustable by governance, but should never be fully unbounded.
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.