`changeMaxGenerationId` allows to mint tokens from older generations retroactively
The contract's minting function does not check that a player's generation and season match the current ones, so when the maximum generation ID is raised, players from older seasons can also be minted. This allows more tokens to be minted than intended.
BAHOZ Follow with Dug, GalloDaSballo and 1 other
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-04-footium-judging/issues/319
Found by
BAHOZ, Dug, GalloDaSballo, juancito
Summary
changeMaxGenerationId is meant to allow more minting for the current generation, however, because of the fact that merkleProofs do not validate for the current season, whenever the limit will be raised, the limit will allow to mint players from older seasons
It will unlock a lot more minting than it may be intended
Vulnerability Detail
If for any reason maxGenerationId is increased, because of the fact that MerkleProofUpgradeable.verify doesn't check for generationIds and seasonId then not only new players from the current season can be minted, but also players from older seasons.
Impact
Minting of X tokens where X is the number of old seasons
Code Snippet
Tool used
Manual Review
Recommendation
Enforce minting exclusively for the current season or change validation to validate the generations and seasons being minted
Discussion
logiclogue
This is an interesting one. A decision needs to be made whether this is the intended behaviour. Marking as 'Sponsor Confirmed'.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the minting logic verifies the Merkle proof but does not validate that the player's generation ID and season ID match the current season.
Impact
If the maximum generation ID is increased, an attacker could mint tokens for every old season, potentially minting many more tokens than intended.
What the attacker needed
MaxGenerationId is increased; attacker has valid Merkle proofs for old seasons
The fix
The contract should enforce that minting is only allowed for the current season, or the validation should check the generation and season being minted.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract lets people mint (create) digital player tokens. It uses a proof to check the player is allowed, but it forgets to check that the player belongs to the current season. So if the limit for the current season is increased, someone could also mint players from past seasons, creating more tokens than planned.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.