# `changeMaxGenerationId` allows to mint tokens from older generations retroactively

FootiumAcademy merkle proof omits season/generation validation, so raising maxGenerationId lets players from older seasons be minted retroactively.

- Payout: Contest reward
- Severity: medium
- Program: Footium
- Credited: BAHOZ
- Disclosed: 2023-04-13
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-04-footium-judging/issues/319
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-04-footium%3AM-6
- Tags: domain:web3 impact:integrity kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** FootiumAcademy.sol minting / merkle proof validation
**Root cause:** MerkleProofUpgradeable.verify does not bind the proof to a specific generationId/seasonId, so any valid old-season leaf passes once maxGenerationId is raised.
**Steps:**
1. Obtain a valid merkle proof/leaf for a player from an older season.
2. Admin calls `changeMaxGenerationId` to raise the limit for the current generation.
3. Call the mint function in FootiumAcademy.sol (L257-269) with the old-season proof; `MerkleProofUpgradeable.verify` succeeds since it ignores generationId/seasonId.
4. Repeat for each old season to mint extra players beyond intended supply.
**How found:** Code review of the mint path: noticed merkle verification does not include generationId/seasonId, then reasoned that raising maxGenerationId retroactively unlocks all older seasons' leaves.
**Exploitation:** Holder of any prior-season merkle leaf waits for maxGenerationId to be raised, then submits old proofs to mint players from retired seasons, inflating supply beyond the intended current-generation cap.
**Insight:** When a merkle root gates minting, check whether the leaf/proof binds all mutable state (season, generation, round); any unbound dimension becomes mintable once its limit is relaxed.
